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.
Hi,
I have a table that contains Clients and Parent Clients. I'm trying to write a DAX measure that displays total revenue at the client level IF the sum of total revenue for the Parent Client is >= 1,000,000 (for example). I tried:
CALCULATE( [Revenue],
FILTER (
ADDCOLUMNS(SUMMARIZE ( client, client[ParentClientNumber]), "xx", [Revenue]),
[xx] >= 1000000
)
)
If I try to nest this measure against ClientNumbers, it only shows where ClientNumber >= 1,000,000 (regardless of what the ParentClient total is).
Thanks for any help.
Solved! Go to Solution.
Hi @mattlcook ,
Sorry for the delay.
For your requirement, you could create the measure below by my test.
Please note that the measure [Sum] is the same as your [Revenue] measure.
Measure = VAR a = CALCULATE ( SUM ( 'Table'[Revenue] ), ALLEXCEPT ( 'Table', 'Table'[Parent Client] ) ) RETURN IF ( a > 1000000, [Sum], BLANK () )
Here is the output.
For more details, you also could refer to my attachment.
Best Regards,
Cherry
Hi @mattlcook ,
I still have a little confused about your scenario.
If it is convenient, could you share some data sample which could reproduce your scenario and your desired output so that we could help further on it?
Best Regards,
Cherry
Hi, thanks for the reply. Here is a screenshot of a simple report showing two parent clients, with their clients nested, as well as three measures. The first measure "Revenue" is just sum(Revenue). The second measure "Tier 1 Revenue Current", which is based on the DAX in my original post. The third measure is "Tier 1 Revenue Desired", which is the measure I'm trying to build. Both Tier 1 Revenue measures supress parent client "xyz" because it's total Revenue is less than 1,000,000. However, you can see that the second measure also supresses client abc1 because it's Revenue is less than 1,000,000. I don't want to do this. The third measure "Tier 1 Revenue Desired" produces the result I am looking for. I am trying to determine the DAX to calculate "Tier 1 Revenue Desired".
Hope that helps. Thanks.
Hi @mattlcook ,
Sorry for the delay.
For your requirement, you could create the measure below by my test.
Please note that the measure [Sum] is the same as your [Revenue] measure.
Measure = VAR a = CALCULATE ( SUM ( 'Table'[Revenue] ), ALLEXCEPT ( 'Table', 'Table'[Parent Client] ) ) RETURN IF ( a > 1000000, [Sum], BLANK () )
Here is the output.
For more details, you also could refer to my attachment.
Best Regards,
Cherry
Thank you - this is great. My only question is whether the formula can be updated to show the Grand Total as the sum of all Parent Companies greater than 1,000,000. If the example below, the grand total should be 7,154,100.
I was going to create it using an ISFILTERED function, but you may have a more efficient approach.
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 |
---|---|
110 | |
97 | |
78 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |