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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Amyries
Frequent Visitor

Dynamic Sclier

Hello,

I have a table that includes the Fiscal Year (FY) field. I want to create a slicer such that when I select FY25, the data and visuals will display both FY24 and FY25. Or select FY24, display FY24 and FY23, and similarly for other years.
Data is here: (I can't attract files or links, just can capture them)

Amyries_0-1735206760463.png

 


As a newcomer to Power BI, I would greatly appreciate your assistance. Thank you!

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Amyries 

You will need a disconnected table (without relationship) as using column from a related table will show just what's been selected and then a measure referencing that table/column to be used as a visual filter

danextian_1-1735212254747.png

 

FY Filter = 
VAR SelectedFY =
    MAX ( FY[FY Number] )
VAR _FY = {
    "FY" & SelectedFY - 1,
    "FY" & SelectedFY
}
RETURN
    CALCULATE (
        COUNTROWS ( 'Date' ),
        KEEPFILTERS ( TREATAS ( _FY, 'Date'[Fiscal Year] ) )
    )

danextian_0-1735212218638.png

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
danextian
Super User
Super User

Hi @Amyries 

You will need a disconnected table (without relationship) as using column from a related table will show just what's been selected and then a measure referencing that table/column to be used as a visual filter

danextian_1-1735212254747.png

 

FY Filter = 
VAR SelectedFY =
    MAX ( FY[FY Number] )
VAR _FY = {
    "FY" & SelectedFY - 1,
    "FY" & SelectedFY
}
RETURN
    CALCULATE (
        COUNTROWS ( 'Date' ),
        KEEPFILTERS ( TREATAS ( _FY, 'Date'[Fiscal Year] ) )
    )

danextian_0-1735212218638.png

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thank you!

Anonymous
Not applicable

Hi @Amyries ,

If danextian's reply can help you, please remember to accept his reply as a solution to help the other members find it more quickly. Thank you!

Best Regards,
Dino Tao

Please accept my post as the solution.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
JennyMilf
Helper I
Helper I

Thank you, but I Select FY24 as the visual just show data for FY23

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.