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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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