Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
I am really having trouble getting the following formula to work in DAX.
If TABLEA.CHECK = "Y" THEN QTY = TABLEB.QTY * TABLEA.PerCarton
ELSE
QTY = TABLEB.QTY
TABLEA.CHECK is Text.
TABLEA.PerCarton is a number.
TABLEB.QTY is a number.
There is a 1 to many relationship on TABLEA.STOCKCODE to TABLEB.STOCKCODE (both Text)
If anyone is able to give any advice it would be greatly appreciated.
Solved! Go to Solution.
There are multiple ways you can do this with measure. An easy way is as below:
Total Quantity = SUMX ( TABLEB, IF ( RELATED ( TABLEA[CHECK] ) = "Y", TABLEB[QTY] * RELATED ( TABLEA[PerCarton] ), TABLEB[QTY] ) )
There are multiple ways you can do this with measure. An easy way is as below:
Total Quantity = SUMX ( TABLEB, IF ( RELATED ( TABLEA[CHECK] ) = "Y", TABLEB[QTY] * RELATED ( TABLEA[PerCarton] ), TABLEB[QTY] ) )
Thank you very much.
This worked perfected. RELATED was the function which I needed...
User | Count |
---|---|
93 | |
83 | |
77 | |
71 | |
65 |
User | Count |
---|---|
114 | |
101 | |
96 | |
65 | |
60 |