Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi,
I want to create two different sets of data on the same report using a year filter. Lets say for one of the data sets I want 2023 and the other data set I want 2024. I practically want to compare last year to the current year.
What I did so far was create to seperate matrix tables and put a year filter on each of them, which worked perfectly fine. Although, it looks very messy and I wanted to create a measure that compared the current year to the past year so having them on the same matrix table would make it much easier.
An example is something like this below:
year 1 year 2 year 3 year 4
2023 xxx
2023 yyy
2024 xxx
2024 yyy
Is this possible, or do I have to create two seperate matrix tables?
Thanks
@Anonymous , You want create this year vs last year
with date table
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
with year or date table
//Only year vs Year, not a level below
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])
Now if select a year and still want all year to display, make sure slicer is on independent table
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
selected Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=selectedvalue('Date1'[Year])))
and then take diff from selected value.
you need two independent tables in case you need two slicers
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Thank you for your guidance, it's very much appreciated.
Am I able to filter multiple conditions (e.g. year is max (2024), it is "xxx" in category column)? I am planning on creating a year table that includes the fields required in the measure.
Here is an example:
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 38 | |
| 31 | |
| 27 | |
| 27 |