Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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])
User | Count |
---|---|
57 | |
21 | |
19 | |
16 | |
16 |
User | Count |
---|---|
86 | |
77 | |
52 | |
37 | |
22 |