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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
rpinxt
Solution Sage
Solution Sage

Automatically exclude months in graphic

Hi All,

We have a graph showing data by month. Nothing veru special.

Now the thing is that data is not yet complete and can be up to 2 months before that data is complete.

 

We are looking for a way that the vizual can show us data excluding the last 2 months it will find in the source.

To make it a bit more visual:

rpinxt_0-1662627875147.png

So in this data set there is data up till August. But August and July we would like to not show.

Of course we can do that in the filter, but then we would have to manually change this every month.

Was trying to see if it could automatically done with 'relative date' option or something.

But can't find anything.

Maybe somebody has an idea how to achieve this (fairly easy)?

1 ACCEPTED SOLUTION
ddpl
Solution Sage
Solution Sage

@rpinxt ,

 

1. Create a calculated column.

Month = 'Table'[Date].[MonthNo]
 
2. Create another calculated column.
Flag = 
var _mm = MAX('Table'[Month])
return
SWITCH(
    TRUE(),
    MONTH('Table'[Date]) = _mm || MONTH('Table'[Date]) = _mm-1, "Exclude",
    "Include"
)
 
3. Put the Flag column in the visual's filter section and tick mark "Include".
bin24.png

View solution in original post

2 REPLIES 2
rpinxt
Solution Sage
Solution Sage

Thanks @ddpl see what you are doing there.

Bit more complicated for me as I am using a calculated date table with multiple sources.

But was able to make it work using the max of the source of the visual and put include and exclude on the month numbers of the date table. 😁
(months of other years posed no problem as the visual looks only at 1 year)

ddpl
Solution Sage
Solution Sage

@rpinxt ,

 

1. Create a calculated column.

Month = 'Table'[Date].[MonthNo]
 
2. Create another calculated column.
Flag = 
var _mm = MAX('Table'[Month])
return
SWITCH(
    TRUE(),
    MONTH('Table'[Date]) = _mm || MONTH('Table'[Date]) = _mm-1, "Exclude",
    "Include"
)
 
3. Put the Flag column in the visual's filter section and tick mark "Include".
bin24.png

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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