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
Tommy123
Frequent Visitor

Creating Matrix with a measure as row values with different years

So I have a mtrix I am creating bellow 

Tommy123_0-1741704474333.png

and this is fine and exactly how I want it where I have the Department and the current ear selected in my calanader slicer and the previous year.
My calander table is not connected to the main data, I am using dax to actually create the ThisYearSales measure where I then filter
Now there are a few things, when I switch the year in my calander table, I lose all my data except for like 3 departments, I checked for example the Department Audio and it has data for 2025 but once I change the year to 2025 it dissapears.
Next I want to the roll up on the department level to be the differene between the percentages if that is even possible?

The reason I disconnected the calander table is because It will only show the the year selected in my matrix when I want the selected year and the previous year

1 ACCEPTED SOLUTION
Tommy123
Frequent Visitor

ThisYearSales =
VAR _thisyr = CONVERT(SELECTEDVALUE(PRC_00034_TEST[YEARNUM]),INTEGER)
VAR lastyr = CONVERT(SELECTEDVALUE(PRC_00034_TEST[YEARNUM]),INTEGER)-1
RETURN
IF(
        min(PRC_00034_RETENTIONBASE6[YEARNUM]) = (_thisyr)||
        min(PRC_00034_RETENTIONBASE6[YEARNUM]) = (lastyr)
        ,MIN(PRC_00034_RETENTIONBASE6[ACTFACTOR_SMRR])
)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Tommy123 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

Deku
Super User
Super User

Need to see the definition of the measure


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Tommy123
Frequent Visitor

ThisYearSales =
VAR _thisyr = CONVERT(SELECTEDVALUE(PRC_00034_TEST[YEARNUM]),INTEGER)
VAR lastyr = CONVERT(SELECTEDVALUE(PRC_00034_TEST[YEARNUM]),INTEGER)-1
RETURN
IF(
        min(PRC_00034_RETENTIONBASE6[YEARNUM]) = (_thisyr)||
        min(PRC_00034_RETENTIONBASE6[YEARNUM]) = (lastyr)
        ,MIN(PRC_00034_RETENTIONBASE6[ACTFACTOR_SMRR])
)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors