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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
eric_005
New Member

Rolling date not capturing the latest month of my dataset

I have this measure created but it is not capturing my latest month of my dataset. 

If I tick April for example, it shows only Mar 23 - Mar 24. But if I tick month of May, the charts are empty.

 

Here is my code.  Please help.

 

**Total Visits | Last 13 Months =
VAR MaxDate = MAX(CalendarTable[Date])
VAR MaxDate_13MonthsAgo = EDATE(MaxDate, -13)
VAR Result =
    IF(
        HASONEVALUE(RollingDate[MonthYear]) &&
            MAX(RollingDate[Date]) <= MaxDate &&
            MIN(RollingDate[Date]) >= MaxDate_13MonthsAgo,
            CALCULATE(
                    [Total Sum Value],
                FILTER(
                    ALL(CalendarTable[Month],CalendarTable[Year],CalendarTable[MonthYear]), CalendarTable[Month] = VALUES(RollingDate[Month] ) && CalendarTable[Year] = VALUES(RollingDate[Year]) && CalendarTable[MonthYear] = VALUES(RollingDate[MonthYear])
                )
            ),
            BLANK()
    )
RETURN
    Result
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

I am not sure about what you want but see if my solution in the attached file helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

I am not sure about what you want but see if my solution in the attached file helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish, your solution is working! Just what I needed! Appreciate your help! 🙂

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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