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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Taariq
New Member

Relative date

Good day

 

I am new to power BI and need some help with relative date,

I have a a dash board with a relative date filter, i know how to show data for last month or last 3 days etc, however i want all the visuals to show a specific single day (3 days ago) my data set has the last 2 days data in it which i don't want shown in the visuals

 

Thanks in advance

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Taariq ,

 

Try below formula:

M = 
VAR day1 =
    DAY ( TODAY () ) - 1
VAR day2 =
    DAY ( TODAY () ) - 2
RETURN
    (
        IF (
            DAY ( MAX ( 'Table'[Date] ) ) = day1,
            1,
            IF (
                DAY ( MAX ( 'Table'[Date] ) ) = day2,
                1,
                IF ( ( DAY ( MAX ( 'Table'[Date] ) ) = DAY ( TODAY () ) ), 1, 0 )
            )
        )
    )

vhenrykmstf_0-1664443648169.pngvhenrykmstf_1-1664443698940.png

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

1 REPLY 1
v-henryk-mstf
Community Support
Community Support

Hi @Taariq ,

 

Try below formula:

M = 
VAR day1 =
    DAY ( TODAY () ) - 1
VAR day2 =
    DAY ( TODAY () ) - 2
RETURN
    (
        IF (
            DAY ( MAX ( 'Table'[Date] ) ) = day1,
            1,
            IF (
                DAY ( MAX ( 'Table'[Date] ) ) = day2,
                1,
                IF ( ( DAY ( MAX ( 'Table'[Date] ) ) = DAY ( TODAY () ) ), 1, 0 )
            )
        )
    )

vhenrykmstf_0-1664443648169.pngvhenrykmstf_1-1664443698940.png

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.