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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CA_LASA
New Member

Show the Day -1 data in relative data filter when the months turns.

I'm having a problem where my dashboard doesn't display data, because the us relative data filter or default sysdate and my data works with Day-1. I need to show the entire month in the filter, but when the month turns (01 / ...) my data is in the last month and I still need to show this data until the second day of the month. Do you know how to solve this pinimba?

1 REPLY 1
dedelman_clng
Community Champion
Community Champion

Hi @CA_LASA -

 

Assuming your data updates at least daily, you can create this column on your date table, then put a filter on Display = 1

 

Display =
VAR __Today =
    TODAY ()
VAR __ThisYear =
    YEAR ( __Today )
VAR __ThisMth =
    MONTH ( __Today )
VAR __ThisDay =
    DAY ( __Today )
RETURN
    SWITCH (
        TRUE (),
        __ThisMth = 1,
            IF (
                __ThisDay IN { 1, 2 },
                IF (
                    MONTH ( DateTab[Date] ) = 12
                        && YEAR ( DateTab[Date] ) = __ThisYear - 1,
                    1
                ),
                IF (
                    MONTH ( DateTab[Date] ) = __ThisMth
                        && YEAR ( DateTab[Date] ) = __ThisYear,
                    1,
                    0
                )
            ),
        IF (
            __ThisDay IN { 1, 2 },
            IF (
                MONTH ( DateTab[Date] ) = __ThisMth - 1
                    && YEAR ( DateTab[Date] ) = __ThisYear,
                1
            ),
            IF (
                MONTH ( DateTab[Date] ) = __ThisMth
                    && YEAR ( DateTab[Date] ) = __ThisYear,
                1,
                0
            )
        )
    )

Hope this helps,

David

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors