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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.