Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
v-shamiliv
Community Support
Community Support

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
Community Champion
Community Champion

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.