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.
Hello everyone!
I had some trouble with DAX expression.
When I try to divide two measures and summarize its result as a whole, it shows me the results of a divided total of two columns, this is not what I expected.
For example:
Nomenclature | qty - sales | qty in box | result | expected |
a | 10 | 2 | 5 | 5 |
b | 20 | 3 | 7 | 7 |
c | 30 | 4 | 8 | 8 |
d | 40 | 5 | 8 | 8 |
a | 20 | 2 | 10 | 10 |
b | 30 | 3 | 10 | 10 |
total | 150 | 19 | 8 | 48 |
*qty - sales and qty in box from different tables
If you have any solution, please share, thanks a lot!
@Anonymous , try like
sumx(summarize(Table, Table[Nomenclature], "_1",sum(Table[qty]),"_2",sum(Table[qty in box])),divide([_1],[_2]))
Or
sumx(values(Table[Nomenclature]), Divide(sum(Table[qty]),sum(Table[qty in box])))
User | Count |
---|---|
86 | |
85 | |
35 | |
35 | |
34 |
User | Count |
---|---|
94 | |
79 | |
63 | |
55 | |
52 |