cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Ttaylor9870
Helper III
Helper III

Filter that shows Next Month and Next 3 months

Hey Experts, Good Afternoon!

 

I need to create a filter where I can select either next month and then next 3 months, for example...

 

Todays date is 21/09/2023 to next month should show Octobers data, Next 3 months should show October, November, December.

 

See example table below...

 

NameDate
AA21/10/2023
BB21/11/2023
CC21/12/2023
DD25/11/2023

 

Many Thanks,

 

Taylor

2 ACCEPTED SOLUTIONS
v-shex-msft
Community Support
Community Support

Hi @Ttaylor9870,

You can create a measure formula to use on 'visual level filter' to compare current row context date and system date to return flag, then you can use this flag as condition to filter correspond records based on current date.

flag =
VAR currDate =
    MAX ( Table[Date] )
VAR _endDate =
    DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) + 3, DAY ( TODAY () ) )
RETURN
    IF ( currDate >= TODAY () && currDate <= _endDate, "Y", "N" )

Applying a measure filter in Power BI - SQLBI

Regsards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

lbendlin
Super User
Super User

Use the filter pane.

 

lbendlin_0-1695732733986.png

 

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Use the filter pane.

 

lbendlin_0-1695732733986.png

 

v-shex-msft
Community Support
Community Support

Hi @Ttaylor9870,

You can create a measure formula to use on 'visual level filter' to compare current row context date and system date to return flag, then you can use this flag as condition to filter correspond records based on current date.

flag =
VAR currDate =
    MAX ( Table[Date] )
VAR _endDate =
    DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) + 3, DAY ( TODAY () ) )
RETURN
    IF ( currDate >= TODAY () && currDate <= _endDate, "Y", "N" )

Applying a measure filter in Power BI - SQLBI

Regsards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors