Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a dataset inclusive of customer spend history. I am looking for a pragmatic way to compare one selected customer, with all others. The others being "grouped".
For instance - Imagine a trendline...show me the average monthly spend of "Customer A" as comapred to all other Customers. The output would be two lines, one representing Customer A, the other line - all other customers.
The motivation for this is to be able compare...
All feedback welecome!
Solved! Go to Solution.
Hi @irnm8dn ,
I'd like to suggest you take a look at following links to know more about 'allselected' function and 'in' operator.
The definitive guide to ALLSELECTED
Please understand that this link is provided with no warranties or guarantees of content changes, and confers no rights.
Regards,
Xiaoxin Sheng
Hi @irnm8dn ,
You can write two measures to calculate and filter on selected records.
For example:
AVG selected = VAR currDate = MAX ( Table[Date] ) RETURN CALCULATE ( AVERAGE ( Table[Amount] ), FILTER ( ALL ( Table ), YEAR ( Table[Date] ) = YEAR ( currDate ) && MONTH ( Table[Date] ) = MONTH ( currDate ) && [Customer] IN ALLSELECTED ( Customer[Customer] ) ) ) AVG Inverse = VAR currDate = MAX ( Table[Date] ) RETURN CALCULATE ( AVERAGE ( Table[Amount] ), FILTER ( ALL ( Table ), YEAR ( Table[Date] ) = YEAR ( currDate ) && MONTH ( Table[Date] ) = MONTH ( currDate ) && NOT([Customer] IN ALLSELECTED ( Customer[Customer] )) ) )
Regards,
Xiaoxin Sheng
I see what you've done here, and less specific to the actual calculation, can you help me undertstand how to simply group the Selected vs. Not Selected in a simple DAX statement so that I can compare the two "groups"?
Much appreciated.
Hi @irnm8dn ,
I'd like to suggest you take a look at following links to know more about 'allselected' function and 'in' operator.
The definitive guide to ALLSELECTED
Please understand that this link is provided with no warranties or guarantees of content changes, and confers no rights.
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |