Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello experts,
I have a question about one of the calculations that I am doing. Suppose, I have 4 products , their grouping and sales value. I have to apply factors for each product. See below table.
Group | Product | Value | Factor | Value_Display |
1 | A | 100 | 1 | 100 |
1 | B | 200 | 0.5 | 100 |
2 | C | 300 | 0.75 | 225 |
2 | D | 400 | 1 | 400 |
Total | 1000 | 825 |
Now, I am using the calculated measure to get the Value_display as below. I get the correct value for the value display but my “Totals” is incorrect. I am getting as “1000” instead of “825”. Also, I have show this in a matrix with hierarchy of Grouping -->Product which is also giving incorrect results.
Value_display =if((SELECTEDVALUE('Table'[Product])="B",0.5*[Value],
IF(SELECTEDVALUE('Table'[Product])="C",0.75*[Value],
[Value]))
Any help will be appreciated!
Thanks,
Lakshay
Solved! Go to Solution.
Is there a reason why the numbers are hardcoded in the DAX formula when they can be found in the table?
This measure should work:
MValue_display = SUMX(TableH, TableH[Factor] * TableH[Value])
Is there a reason why the numbers are hardcoded in the DAX formula when they can be found in the table?
This measure should work:
MValue_display = SUMX(TableH, TableH[Factor] * TableH[Value])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
43 | |
23 | |
21 | |
15 | |
15 |
User | Count |
---|---|
45 | |
31 | |
30 | |
18 | |
17 |