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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Fangyi8
Frequent Visitor

Previous day/date values

Hi guys, please i need help. I am trying to calculate the daily growth rate and I used this formula to get what I have in the "previous" column: 

previous =
CALCULATE(
[current], PREVIOUSDAY('public sales_reports'[sale_dt]))

 

However, if the day is not the previous one, it doesn't work. I tried using EARLIER() but it did not work either. 
Is there anyway to go about this and make the empty columns that have true beside them to have values? Well, except the first column. Help please!

 

sale_dtRevenuecurrentprevious 
27.09.2021 00:00-882.00 ₽-882,00 RUB TRUE
15.12.2021 00:00-199.13 ₽-199,13 RUB TRUE
16.12.2021 00:00-398.00 ₽-398,00 RUB-199,13 RUBFALSE
20.12.2021 00:00-199.00 ₽-199,00 RUB TRUE
21.12.2021 00:00-1297.00 ₽-1 297,00 RUB-199,00 RUBFALSE
22.12.2021 00:00-647.00 ₽-647,00 RUB-1 297,00 RUBFALSE
23.12.2021 00:00-249.00 ₽-249,00 RUB-647,00 RUBFALSE
24.12.2021 00:00-1172.00 ₽-1 172,00 RUB-249,00 RUBFALSE
25.12.2021 00:00-897.00 ₽-897,00 RUB-1 172,00 RUBFALSE
26.12.2021 00:00-816.00 ₽-816,00 RUB-897,00 RUBFALSE
27.12.2021 00:00-1052.02 ₽-1 052,02 RUB-816,00 RUBFALSE

Thanks in advance!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

In case there is no calendar table, please try like the below and the attached pbix file.

Jihwan_Kim_0-1667576039616.png

 

 

Previous measure: = 
VAR _prevdate =
    MAXX (
        FILTER (
            ALL ( 'public sales_reports'[sale_dt] ),
            'public sales_reports'[sale_dt] < MAX ( 'public sales_reports'[sale_dt] )
        ),
        'public sales_reports'[sale_dt]
    )
RETURN
    IF (
        HASONEVALUE ( 'public sales_reports'[sale_dt] ),
        CALCULATE ( [current measure:], 'public sales_reports'[sale_dt] = _prevdate )
    )

 


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.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

In case there is no calendar table, please try like the below and the attached pbix file.

Jihwan_Kim_0-1667576039616.png

 

 

Previous measure: = 
VAR _prevdate =
    MAXX (
        FILTER (
            ALL ( 'public sales_reports'[sale_dt] ),
            'public sales_reports'[sale_dt] < MAX ( 'public sales_reports'[sale_dt] )
        ),
        'public sales_reports'[sale_dt]
    )
RETURN
    IF (
        HASONEVALUE ( 'public sales_reports'[sale_dt] ),
        CALCULATE ( [current measure:], 'public sales_reports'[sale_dt] = _prevdate )
    )

 


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.

Thank you very much for your help!
It worked perfectly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors