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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm creating a Power BI dashboard using Zebra BI table visual with two columns: PY (Previous Year) and AC (Actuals). In my database "Baza 23," I have a column "Scenarij" that refers to either 2022 (Previous Year) or 2023 (Actuals).
I also have a calendar table and I have made a connection between the calendar table (date column) and "Baza 23" (date column).
I made two measures:
1: AC filter = CALCULATE(SUM('Baza 23'[EUR]), 'Baza 23'[Scenarij] = "2023")
2: PY filter = CALCULATE(SUM('Baza 23'[EUR]), 'Baza 23'[Scenarij] = "2022")
When I put these measures in the Zebra BI table, they work perfectly fine. However, I want to put an MTD/QTD/YTD slicer and connect it to these two columns so that when I choose a scenario in this slicer, the data in the PY column and AC column change accordingly. To achieve this, I created a "Selected Period" table with two columns: Period column and Period ID:
I added Selected period measure: Selected Period = MIN('Selected Period'[Period ID]). I was able to connect my columns to MTD/QTD/YTD slicer by using these two measures:
AC = SWITCH('Selected Period'[Selected Period],
1, CALCULATE([AC filter], DATESMTD('Calendar'[Date])),
2, CALCULATE([AC filter], DATESQTD('Calendar'[Date])),
3, CALCULATE([AC filter], DATESYTD('Calendar'[Date]))
PY = SWITCH('Selected Period'[Selected Period],
1, CALCULATE([PY filter], DATESMTD('Calendar'[Date])),
2, CALCULATE([PY filter], DATESQTD('Calendar'[Date])),
3, CALCULATE([PY filter], DATESYTD('Calendar'[Date])))
AC measure works perfectly fine, but when I use the PY measure and put it in the Zebra BI table, the column doesn't show any numbers. Why is that and how can I fix this problem?
Solved! Go to Solution.
Hi @Ema123 ,
@olgad gives some direction and reasons on your problem. (@olgad Thanks to for your efforts).
Please try to update the formula of below measures as below and check if they can return the expected result...
AC filter =
VAR _selyear =
SELECTEDVALUE ( 'Calendar'[Year] )
RETURN
CALCULATE ( SUM ( 'Baza 23'[EUR] ), 'Baza 23'[Scenarij] = _selyear )PY filter =
VAR _selyear =
SELECTEDVALUE ( 'Calendar'[Year] )
RETURN
CALCULATE (
SUM ( 'Baza 23'[EUR] ),
FILTER ( 'Baza 23', 'Baza 23'[Scenarij] = _selyear - 1 ),
ALL ( 'Baza 23' )
)
If the above ones can't help you figure out, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi, thank you for your respond. The only other slicer that I am using is "Month" slicer form 'Calendar'[Month]. Is there a way to write these measures in a way they are not hardcoded?
Hi @Ema123 ,
@olgad gives some direction and reasons on your problem. (@olgad Thanks to for your efforts).
Please try to update the formula of below measures as below and check if they can return the expected result...
AC filter =
VAR _selyear =
SELECTEDVALUE ( 'Calendar'[Year] )
RETURN
CALCULATE ( SUM ( 'Baza 23'[EUR] ), 'Baza 23'[Scenarij] = _selyear )PY filter =
VAR _selyear =
SELECTEDVALUE ( 'Calendar'[Year] )
RETURN
CALCULATE (
SUM ( 'Baza 23'[EUR] ),
FILTER ( 'Baza 23', 'Baza 23'[Scenarij] = _selyear - 1 ),
ALL ( 'Baza 23' )
)
If the above ones can't help you figure out, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi, on the page itself, are you selecting any years from the calendar slicer/filter?
You have hardcoded years in your measures, so it might happen some other filters prevent you from seeing the numbers. Can you please give more info?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 18 | |
| 12 | |
| 11 |