Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello,
I would appreciate it so much if you can help me here please.
I would like to select a year from a slicer, but the records from the Selected year & records from Previous year to be shown. How can I achieve something like that?
Best regards,
Simon
Solved! Go to Solution.
Thank you so much @FreemanZ
Unfortunately, this didn't work for me, as the Date Table is realted to Orders, and other tables in the dashboard.
Do you think it's still possible to tweak the measure please so that it shows the selected year and the previous one? Your help is so much appreciated.
Best regards,
Simon
you can try like:
Measure =
CALCULATE([...], EDATE(TableName[Date], -12))
or if you have dedicated date table, try Time Intelligence functions, like:
CALCULATE([...], DATEADD(TableName[Date], -1, YEAR))
CALCULATE([...], SAMEPERIODLASTYEAR(TableName[Date]))
and many more.
Hi @FreemanZ ,
But I don't need measures to calculate anything, I just need a table visual to show the records belonging to the selected year & previous year, as shown in the screenshot above.
Thank you,
Simon
supposing you have two unrelated tables like:
1) plot a table visual with all the columns from the first table, choose "don't summarize" for every column.
2) write a measure like:
YearFilter =
VAR _year = SELECTEDVALUE(Year[Year])
RETURN
IF(
YEAR(MAX(TableName[OrderDate])) IN {_year, _year-1},
1,0
)
3) feed the measure to the filter pane for the table visual and choose 1
it worked like this:
Thank you so much @FreemanZ
Unfortunately, this didn't work for me, as the Date Table is realted to Orders, and other tables in the dashboard.
Do you think it's still possible to tweak the measure please so that it shows the selected year and the previous one? Your help is so much appreciated.
Best regards,
Simon
The measue could be tweaked to ignore the slicer, but you still have orderdate columns, which are anyway filtered by the Year slicer.
So in cases like this, try to create an small independent table for the year slicer.
You may import one from excel, create one from Power Query Editor, or with DAX code like:
Year =
SELECTCOLUMNS(
{2022, 2023},
"Year", [Value]
)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
7 | |
4 | |
3 |
User | Count |
---|---|
14 | |
13 | |
11 | |
10 | |
10 |