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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
zurimae
Frequent Visitor

Measure for calculating yesterdays count vs last week count

Hello, 

I need help creating a measure that will show me the difference of count of phone calls received yesterday (example: Tuesday) compared to last Tuesday. For example, so i could show the skill "Intake" had 12 more calls this tuesday vs last tuesday.  or the skill "stroke" had -7 less calls yesterday vs last tuesday. I have a measure to calculate how many calls less than the previous day, but i cant see to figure out how to do it from yesterday to the same day last week.  below is the measure i use for 1 day difference.

zurimae_0-1718828213277.png

 

Measure 2 = SUM(
    'Phone Queue Data'[Total Calls Offered]
)
- CALCULATE(
    SUM(
        'Phone Queue Data'[Total Calls Offered]
    ),
    DATEADD(
        'Calendar Lookup'[Date],-1,
        DAY
    )
)

 

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1718852542550.png

 

Jihwan_Kim_1-1718852723900.png

 

Yesterday result: = 
VAR _yesterday =
    TODAY () - 1
RETURN
    CALCULATE (
        SUM ( phone_queue_data[total_calls_offered] ),
        'calendar'[Date] = _yesterday
    )

 

Yesterday of last week result: = 
VAR _yesterdayoflastweek =
    TODAY () - 8
RETURN
    CALCULATE (
        SUM ( phone_queue_data[total_calls_offered] ),
        'calendar'[Date] = _yesterdayoflastweek
    )

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hello, thank you for the response. This measure just isn't calculating correctly, the difference from the two days.

If i use the measure you provided, the correct answer for "casepod" would be -4. but it's showing 74.

zurimae_0-1719237518885.png

Here is the measure you provided (with some edits)

Yesterday of last week result: =
VAR _yesterdayoflastweek =
    TODAY () - 8
RETURN
    CALCULATE (
        SUM ('Phone Queue Data'[Total Calls Offered] ),
        'Phone Queue Data'[Date]= _yesterdayoflastweek
    )

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.