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.
Hello Power Users,
I'm trying to create a dax measure for below table structure. If the Flag = Y then take max of sales and if flag = "N" then sum of sales for all the months.
Year | Month | Customer | Sales | Flag |
2022 | 1 | ABC | 100 | N |
2022 | 2 | ABC | 55 | N |
2022 | 3 | ABC | 110 | N |
2022 | 1 | XYZ | 110 | Y |
2022 | 2 | XYZ | 110 | Y |
2022 | 3 | XYZ | 110 | Y |
I have Year and Customer slicers on the page.
How can we achive this. Please help.
Thanks
Solved! Go to Solution.
create below measure
let me know if this is what you want.
Proud to be a Super User!
Hi, @Ainala
Please try measure as below:
Measure = SWITCH(MAX('Table'[Flag]),"N",SUM('Table'[Sales]),"Y",MAX('Table'[Sales]))
If it does't work, please provide more details for further investigation.
Best Regards,
Community Support Team _ Eason
create below measure
let me know if this is what you want.
Proud to be a Super User!
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 |
---|---|
109 | |
96 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |