Forum Discussion
bob57
4 years agoHelper IV
Calculated Column
Hello, I'm hoping that someone can provide me with the DAX to accomplish the following Thank you for your time, Bob Here is the raw data: I need to add the calculated column, Difference: ...
- 4 years ago
Hi bob57
Here is a sample file with the solution https://we.tl/t-KWLD6ZeAMfDifference = VAR CurrentBase = Data[Base] VAR CurrentRating = Data[Rating] VAR CurrentMatchYesRating = CALCULATE ( MAX ( Data[Rating] ), ALLEXCEPT ( Data, Data[Match] ), Data[Base] = "yes" ) VAR Result = IF ( CurrentBase = "no", CurrentRating - CurrentMatchYesRating, 0 ) RETURN ROUNDDOWN ( Result, 0 )You may need to readjust the rounding type as per your requirement.
tamerj1
4 years agoCommunity Champion
Hi bob57
Here is a sample file with the solution https://we.tl/t-KWLD6ZeAMf
Difference =
VAR CurrentBase = Data[Base]
VAR CurrentRating = Data[Rating]
VAR CurrentMatchYesRating = CALCULATE ( MAX ( Data[Rating] ), ALLEXCEPT ( Data, Data[Match] ), Data[Base] = "yes" )
VAR Result =
IF (
CurrentBase = "no",
CurrentRating - CurrentMatchYesRating,
0
)
RETURN
ROUNDDOWN ( Result, 0 )You may need to readjust the rounding type as per your requirement.
bob57
4 years agoHelper IV
That did the trick! Thank you so much.