Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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)
As a newcomer to Power BI, I would greatly appreciate your assistance. Thank you!
Solved! Go to Solution.
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
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] ) )
)
Please see the attached sample pbix.
Proud to be a 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
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] ) )
)
Please see the attached sample pbix.
Proud to be a Super User!
Thank you!
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.
Proud to be a Super User!
To create a slicer that dynamically filters the data to include the selected fiscal year (FY) and its preceding year, you can follow these steps in Power BI:
Go to the Modeling tab and select New Column.
Use the following DAX formula to create a new column, e.g., ShowFY:
Replace 'Table' with the name of your table. This column will create a filterable field based on the selected fiscal year and its preceding year.
Create a Slicer:
Link the Slicer to Your Visuals:
Test the Slicer:
Let me know if you need further adjustments or explanations!
Thank you, but I Select FY24 as the visual just show data for FY23
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
104 | |
69 | |
48 | |
41 | |
34 |
User | Count |
---|---|
164 | |
112 | |
62 | |
54 | |
38 |