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.
I am trying to build a tabular cube measure that will always calculate the percentage from the column total even when using a matrix.
In the example attached i would like to get X % of Total and Y % of Toal columns.
The measure should be dynamic and work with regardless of the dimension the user will place in the columns so the option of using Calculate(SUM(Salse_Quantity),ALL(Products[Product Name])) or Calculate(SUM(Salse_Quantity),ALLSELECTED(Products)) is not good enough.
Is there any way to achieve this?
Thanks!
You cannot detect what is on rows or what is on columns in DAX, so you cannot do a true "Column Total". However, something like this, may work for you:
SUM(Salse_Quantity) /
Calculate(SUM(Salse_Quantity)
,Product
,ALLSELECTED()
)
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |