The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |