The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi guys,
Wondering how I can Divide with a filter - below is a dateset example.
I'd like to divide the sum of B by the sum of C.
Expected result should be 37.5% - what is the best / most efficient approach with DAX?
Thanks in advance!
Solved! Go to Solution.
@peterso ,
Try like
divide(calculate(sum(Table[value]),Table[Category]="B"),calculate(sum(Table[value]),Table[Category]="C"))
or
divide(calculate(sum(Table[value]),filter(Table,Table[Category]="B")),calculate(sum(Table[value]),filter(Table,Table[Category]="C")))
@peterso ,
Try like
divide(calculate(sum(Table[value]),Table[Category]="B"),calculate(sum(Table[value]),Table[Category]="C"))
or
divide(calculate(sum(Table[value]),filter(Table,Table[Category]="B")),calculate(sum(Table[value]),filter(Table,Table[Category]="C")))
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |