Filtering From 2 different tables in DAX - excel

I am having a little trouble figuring out how to properly filter from the one side through a many relationship and back through to another one sided table.
The issue is that a Customer can have multiple accounts which can have multiple Customers.
In the attached image I am trying to filter from a Center# through the All Customer level and then add a filter on the List table to get the correct open accounts.
So the example would be I am looking for all Customers that are associated with Center A and are attached to an account type A.
The inactive one to many relationship from All Cust -> All Accts is what needs to be active instead of the All Cust -> Open table.
I am currently using:
CALCULATE([Cust Enrolls],CROSSFILTER('All Cust'[All Customer Number],'Open'[Primary Customer Number],Both))
to be able to filter for the account type, but that table's customer is just the single primary customer.
Any ideas on how I should either rework the model or how to create the correct measure?
Model

I would recommend re-working your Data Model so that you have a clear 1-M for each dimension table to your fact tables. This will save you a tremendous amount of time and headaches now and in the future by structuring your data properly.

Related

Auto-Assign Unique Value to Names in Two Columns in Excel

I have a sticky problem that I can't figure out how to do anyway but manually. Maybe you all can help me find a formula that would do this automatically. Here's the set-up.
My organization is currently switching CRM databases, and instead of paying the new CRM for a data upload they have tasked me with uploading the new data. Ok, no big deal, I've done it before, and it's not the worst.
However, the big problem I discovered is that with one of the databases (Raisers Edge NXT) I had to export the whole database out in two sections - one of the constituents and one of the gifts assigned to the constituents. FOR SOME REASON they exported these lists with no unique ID common between them.
So for example - I have a constituent ID for a record in the constituent list and I have a gift record for that constituent but nothing shared between them other than a name, which unfortunately might not be enough for the new Everyaction system to recognize when doing auto-uploads. So my solution is to create a unique Import ID for this import and add a unique ID to every unique name across the consituent and gift record lists so I can run two imports - one of the constituent and then one of the gifts and assign the gifts to the constituents.
Here's the big question how can I assign both lists the same unique IDs without having to go through all 3-4 thousand records manually?
Here's some sample data:
Sample Data of Problem:

SSAS cube login specific security on data

I've encountered the following problem - I already have a working cube that processes lots of data on a schedule. The requirement I got now was to restrict the data in the cube according to specific logins. I'm aware of dynamic SSAS cube security through roles or even logins but I don't see them helping me as I have a kind of a hybrid scenario, and it is as follows:
For example, imagine you have a cube processing sales and income of an international trading company, and you belonged to a role of country directors; what I want to do is adjust permissions so that every country director sees all the measures and dimensions, but they see sales/income only from their country.
Is this possible?
All help is appreciated.
EDIT: I might not have made the best example above. My scenario is slightly different, in a way that there isn't a business rule that would place any two users in a same group. Basically, every user has to see only data that somehow refers to him/her. And this really can't be done manually as there's over 4000 users...
Best regards,
MK_
Yes, both Tabular and Multidimensional SSAS have row filtering options. In your scenario you need:
A Country dimension
Create a role for each Country that has directors
Assign each director to their specific role
Row filter each role by their correspondant Country dimension

How to create m2m relationship in PowerPivot

So I am trying to link an employee metrics pivot chart with an employee project table with one slicer. I want an employee slicer that manipulates all charts but the data is coming from 2 different places (SQL, Sharepoint). When I try to create a relationship based on Employees I get the following error: "The relationship cannot be created because each column contains duplicate values. Select at least one column that only contains unique values."
So one chart has quantitative items while the table has qualitative items and I want one slicer to manipulate both at the employee level.
I want to see all the data on both charts for the selected employee, and not just single items linked by unique values. I can use unique values, and have created relationships that one slicer can manipulate however I only get one record at a time that way and therefore the slicer has thousands of buttons (one for each record).
I wouldn't think this would be that difficult and I hope it's really not.
Please Help!
M2M relationships in PowerPivot will most likely cause more headaches than solutions unless you are aware of what you are doing. After some thought, I realized that I really do not want an m2m relationship because it would result in junk data for what I wanted. I just wanted to start my answer off acknowledging that I did not achieve an m2m.
So if you want to link SharePoint data to Excel here is what you need to do:
Export SharePoint data as an RSS feed. If this is something others will need to refresh then the rss file will need to be stored on a shared drive.
Add PowerPivot if you have not already done so. In PowerPivot get external data from other sources (rss feed) then add your file. To link data you will need a Unique ID to join tables on.

Create Excel Contact database

I would like to create a database based on the following reasoning:
I want to assign to each contact I have some tags for his abilities, for example, so there will be a column called "abilities". So I was thinking about creating a list of possible abilities (probably on a second sheet), lets say "play football", "cook", "ride a bike" and define that "Mike" can "play football.
For this to be useful I would also like to know how it is possible to be able to filter my contacts by ticking on the list of abilities I am looking for.
There are a couple of ways to tackle this.
1) Make a table that has contacts and abilities all together. This means that you will repeat the contact info if a person has multiple abilities. Each row will be the unique combination of contact + ability. If you want to limit the options for ability to specific choices, create your list of abilities and use data validation to create a drop-down list of these values in your abilities column.
2) Make 3 tables: 1-Contact, 2-Abilities, 3-Map of Contacts to Abilities (each row contains the unique identifier for a contact and the unique identifier for an ability). I'm not sure if you really intend to make a database or just something in Excel that works. If you can use PowerPivot, that would be a good solution without needing another application to create your db. Bring your 3 tables into PowerPivot. Create a relationship between table 3 and table 1. Create a relationship between table 3 and table 2.

Portal displaying data from two tables

I have two tables which both include a date field. Currently I have two portals, one for each table (occurrence).
Is it was possible to display the results of both of these in one portal, and sort by the date?
Technically a portal can only display records from one table. If you need to join two tables then you have to do this manually or change the design and use one table instead of two (since you want them in the same portal, then the tables are similar to some degree; maybe this similarity can go into its own table).
Sometimes developers use the so-called virtual table technique: they create a table with, say, a field with the record number and a bunch of calculated fields that pick their values from elsewhere, for example, from prefilled global variables. They create a portal to this table, set up the relationship to display the required number of records, and write the code to fill these variables. This way they can show data that isn't stored in any table, combine tables, etc. But it's an arcane technique, I would recommend it only as the last resort.

Resources