The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now
Hi All,
I have 2 measures and i am creating 3rd measure based on measure1 and measure2. But Measure3 showing wrong total sum.
Measure1 = CALCULATE (
SUM(Table1[AMOUNT]))
Measure2 = has static value 100 for each row
Measure3 = CALCULATE(IF([Measure 3]>[Measure2],[Measure 3],0))
Result is shown below:
Tax Group Measure1 Measure2 Measure3
A 200 100 200
B 300 100 300
C 50 100 0
D 50 100 0
Total ------ ------ --------
600 400 600
Please tell me, how can i show exact total??
Thanks,
Narender
Solved! Go to Solution.
Hi @Narender
Please try this calculated measure
Measure3 = SUMX(VALUES('Table1'[Tax Group]),IF([Measure1]>[Measure2],[Measure1],0))
Hi @Narender
Please try this calculated measure
Measure3 = SUMX(VALUES('Table1'[Tax Group]),IF([Measure1]>[Measure2],[Measure1],0))
Hi Phil,
Thanks a alot. Its working .
Can you please descriibe about your dax expression?
Thanks,
Narender
HI @Narender
In this case, I am using one of the DAX iterator functions. SUMX will loop as many times as there are rows in the table passed as the first argument. This is how I can force the total row to be a sum of a series of smaller calculations, rather than just using the total values from the other columns.
User | Count |
---|---|
161 | |
111 | |
96 | |
87 | |
75 |
User | Count |
---|---|
158 | |
136 | |
133 | |
81 | |
61 |