Forum Discussion
Suhel_Ansari
8 months agoHelper V
Wrong Total in Table
Hi all, I am getting worng total, I am tryint to calcualte the price of Power BI Licsenes cost for PPU, PRO and Free users using the following table and dynamically calculate the total which I am get...
- 8 months ago
Hi GeraldGEmerick - I got the answer using the ADDCOLUMNS however I have to use the multiple ADDCOLUMNS can you please help me to optimze this measure. Thanks
jgeddes
8 months agoSuper User
Something like this approach may also work for you.
Measure =
var _vTable =
SUMMARIZE(
'Table',
'Table'[License],
"__count", COUNT('Table'[License])
)
var _multiplier =
SWITCH(
SELECTEDVALUE('Table'[License]),
"PPU", 22.5,
"Pro", 13.1,
"Free", 13.1,
BLANK()
)
RETURN
SUMX(
_vTable,
[__count] * _multiplier
)
This creates a virtual table that summarzes the intial table by licence with the count of each license. The SWITCH _multiplier variable provides the correct multiplier for each licence type.
The return statement sums the lines of the virtual table, multiplying the licence counts by the correct amount.
Suhel_Ansari
8 months agoHelper V