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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Unable to show measure values in matrix based on slicer selection

Hi All,
In matrix am unable to show measures(measures are YOY DIFF and YOY%change) based on slicer selction which contains Year 1  and Year 2.
But my visual also contains two values  which are directly coming from tables(system total and No/yes. Am able to show these values based on slicer selction

 Check these measures

Final_Fee YOY % Diff =
 
VAR lastSelectedYear = CALCULATE ( LASTNONBLANK (res_lv2[DATE_COLUMN].[Year], 1 ), FILTER ( ALLSELECTED ( res_lv2[DATE_COLUMN].[Year]), res_lv2[DATE_COLUMN].[Year] < MIN (res_lv2[DATE_COLUMN].[Year]) ) )

VAR lastSelectedYears = CALCULATE ( SUM(res_lv2[legacy_final_fee]), FILTER ( ALL (res_lv2[DATE_COLUMN].[Year] ), res_lv2[DATE_COLUMN].[Year]= lastSelectedYear ) )

RETURN IFERROR(IF ( ISBLANK ( lastSelectedYears ), BLANK (),( SUM(res_lv2[legacy_final_fee]) - lastSelectedYears )/lastSelectedYears),0)
 
Legacy_Final_Fee_Diff =
 
VAR lastSelectedYear = CALCULATE ( LASTNONBLANK (res_lv2[DATE_COLUMN].[Year], 1 ), FILTER ( ALLSELECTED (res_lv2[DATE_COLUMN].[Year]), res_lv2[DATE_COLUMN].[Year] < MIN ( res_lv2[DATE_COLUMN].[Year]) ) )

VAR lastSelectedYears = CALCULATE ( SUM(res_lv2[legacy_final_fee]), FILTER ( ALL (res_lv2[DATE_COLUMN].[Year]), res_lv2[DATE_COLUMN].[Year]= lastSelectedYear ) )

RETURN IF ( ISBLANK ( lastSelectedYears ), BLANK (), SUM(res_lv2[legacy_final_fee]) - lastSelectedYears )
These are the measures I used in the matrix visual
In values section I dumped these measures and two columns
In column section I dumped Annual and DATE_COLUMN

Appreciate the efforts
Thanks
 
2 ACCEPTED SOLUTIONS
v-xiaotang
Community Support
Community Support

Hi @Anonymous

Not very sure what's your data and what's your expected result, so I made a little change on your measure, please try this

Legacy_Final_Fee_Diff = 
VAR lastSelectedYear =
    CALCULATE (
        MAX(res_lv2[DATE_COLUMN]),
        FILTER (
            ALL(res_lv2),
            YEAR(res_lv2[DATE_COLUMN])< YEAR( MIN ( res_lv2[DATE_COLUMN] ))
        )
    )
VAR lastSelectedYears =
    CALCULATE (
        SUM ( res_lv2[legacy_final_fee] ),
        FILTER (
            ALL ( res_lv2),
            YEAR(res_lv2[DATE_COLUMN])<= YEAR(lastSelectedYear)
        )
    )
RETURN lastSelectedYears
Final_Fee YOY % Diff = 
VAR lastSelectedYear =
    CALCULATE (
        MAX(res_lv2[DATE_COLUMN]),
        FILTER (
            ALL(res_lv2),
            YEAR(res_lv2[DATE_COLUMN])< YEAR( MIN ( res_lv2[DATE_COLUMN] ))
        )
    )
VAR lastSelectedYears =
    CALCULATE (
        SUM ( res_lv2[legacy_final_fee] ),
        FILTER (
            ALL ( res_lv2),
            YEAR(res_lv2[DATE_COLUMN])<= YEAR(lastSelectedYear)
        )
    )
RETURN
    IFERROR (
        IF (
            ISBLANK ( lastSelectedYears ),
            BLANK (),
            ( SUM ( res_lv2[legacy_final_fee] ) - lastSelectedYears ) / lastSelectedYears
        ),
        0
    )

 

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Hope you are doing well.
Can we close this thread now if there is no other question? It would be nice if you can accpet my answer as the solution. Thanks 🙂

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Hope you are doing well.
Can we close this thread now if there is no other question? It would be nice if you can accpet my answer as the solution. Thanks 🙂

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

v-xiaotang
Community Support
Community Support

Hi @Anonymous

Not very sure what's your data and what's your expected result, so I made a little change on your measure, please try this

Legacy_Final_Fee_Diff = 
VAR lastSelectedYear =
    CALCULATE (
        MAX(res_lv2[DATE_COLUMN]),
        FILTER (
            ALL(res_lv2),
            YEAR(res_lv2[DATE_COLUMN])< YEAR( MIN ( res_lv2[DATE_COLUMN] ))
        )
    )
VAR lastSelectedYears =
    CALCULATE (
        SUM ( res_lv2[legacy_final_fee] ),
        FILTER (
            ALL ( res_lv2),
            YEAR(res_lv2[DATE_COLUMN])<= YEAR(lastSelectedYear)
        )
    )
RETURN lastSelectedYears
Final_Fee YOY % Diff = 
VAR lastSelectedYear =
    CALCULATE (
        MAX(res_lv2[DATE_COLUMN]),
        FILTER (
            ALL(res_lv2),
            YEAR(res_lv2[DATE_COLUMN])< YEAR( MIN ( res_lv2[DATE_COLUMN] ))
        )
    )
VAR lastSelectedYears =
    CALCULATE (
        SUM ( res_lv2[legacy_final_fee] ),
        FILTER (
            ALL ( res_lv2),
            YEAR(res_lv2[DATE_COLUMN])<= YEAR(lastSelectedYear)
        )
    )
RETURN
    IFERROR (
        IF (
            ISBLANK ( lastSelectedYears ),
            BLANK (),
            ( SUM ( res_lv2[legacy_final_fee] ) - lastSelectedYears ) / lastSelectedYears
        ),
        0
    )

 

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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