Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

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.

gracechong_0-1624566683228.png

 

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 1
lbendlin
Super User
Super User

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.