Forum Discussion

Tommy123's avatar
Tommy123
Frequent Visitor
1 year ago
Solved

Creating Matrix with a measure as row values with different years

So I have a mtrix I am creating bellow 

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

  • 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])
    )

3 Replies

  • Deku's avatar
    Deku
    Super User

    Need to see the definition of the measure

    • Tommy123's avatar
      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])
      )
  • Anonymous's avatar
    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.