Forum Discussion
AND IF in conditional column
My Measure =
VAR ValueToGet = SELECTEDVALUE(TableName[BillingMethod])
RETURN
IF(ValueToGet = "FP", [Total_Invoice].[Total_InvoiceTM])
Thank you so much, it worked. I am new to learning power bi and dax. Can you please any book or online course where I can learn better and explore on myself.
- GilbertQ6 years agoSuper User
Hi there
No worries glad to help out
My mate MattAllington has a great course here: https://exceleratorbi.com.au/courses-overview/
- Michiel6 years agoResolver III
'Wrong totals' is usually an effect of misunderstanding what the total row contains: it is not the total of the rows above, it's the result of the same measure in a different context, in this case without the row identifiers filtered.
So your measure is not a simple SUM, but you do want the total to add up. The solution in this case is to force DAX to calculate results on a row-by-row basis, you can do this with SUMX. Trying to mimic your model:SUMX(VALUES(ProjectTable[Complete Project Detail]), [Your original measure])
or, if Complete Project Detail is unique in the Project table:
SUMX(Project, [Your original measure])
If you don' want to call another measure [Your original measure] but want to include the logic in this measure directly, it's probably safest to wrap it in CALCULATE:
SUMX(
VALUES(ProjectTable[Complete Project Detail]),
CALCULATE(<Your original formula goes here>)
) - Anonymous6 years agoNot applicable
My measure is having the above calculation. The main measure is " Pay Distribution Project" . Can you please suggest now ,where I am going wrong.