Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Calculate amount diff from 2 different fields; based on 2 different run dates from the same column

Hi,

I have a Power BI Matrix below which I am comparing "Current Score" from the current run date of 30 June; vs the "Previous Score" from the previous run date of 31 Dec. These respective run dates are coming from the same RUN DATE column. It is just that both of them are generated using a date slicer. 

As you can see in Variance Score below, it seems to be variance from current score and previous score of the same run date; instead of comparing current score from 30 June 2021 to previous score from 31 Dec 2019.

 

I have intially thought it is due to HASONEFILTER but it doesn't seem so. Any idea what could be the error here?
Below is the formula I've used:

Variance Score =

VAR CurrentScore =
SUM ( Scorecard[Score] )

VAR PreviousScore = CALCULATE([Score],ALL('Current date'),DATEADD('Current Date'[RUN DATE],[Date Diff],DAY))

RETURN

IF(HASONEFILTER(Scorecard[RUN DATE]),CurrentScore - PreviousScore,"X")

 

1 Reply

  • Anonymous Please provide sample data in usable format (not as a picture - maybe insert into a table?) and show the expected outcome.