March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Product | Sales | Category | Coefficient |
P1 | 100 | Food | 0.2 |
P2 | 50 | Leisure | 0.4 |
P3 | 200 | Food | 0.2 |
P4 | 300 | Leisure | 0.4 |
P5 | 400 | Leisure | 0.4 |
I have a table like this and I create measures like these:
EligibleCategory = IF(MAX(Table[Category]) IN {"Leisure"}, "YES", "NO")
EligibleSales = IF(0.5*SUM(Table[Sales]) >= 50, "YES", "NO")
Taxes = IF(EligibleSales = "YES" && EligibleCategory = "YES", MAX(Table[Coefficient]) * SUM(Table[Sales]), 0)
With these measures, I should get something like this:
Product | Sales | Category | Coefficient | EligibleCategory | EligibleSales | Taxes |
P1 | 100 | Food | 0.2 | NO | YES | 0 |
P2 | 50 | Leisure | 0.4 | YES | NO | 0 |
P3 | 200 | Food | 0.2 | NO | YES | 0 |
P4 | 300 | Leisure | 0.4 | YES | YES | 120 |
P5 | 400 | Leisure | 0.4 | YES | YES | 160 |
Total | 950 | YES | YES | 280 |
Most importantly, I want to know how to write my measures in a way that the total comes out to be 280 (sum of visible rows) instead of computing the measures on the aggregate result and giving the wrong total.
Solved! Go to Solution.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |