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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Fara-15
New Member

Variance between two columns in Matrix appears twice

Hello, 

I have a matrix in which I am comparing the forecast versions. However, the variance repeats after each version. What is the workaround to show the delta in one column? Appreciate your help very much. 

 

This is what I have:

AccountForecast JanVarianceForecast FebVariance
A4262
B5-41-4

 

This is what I want:

AccountForecast JanForecast FebVariance
A462
B51-4
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Fara-15 

You can refer to the following solution.

Sample data 

vxinruzhumsft_0-1709026318366.png

Sample measure

Sum = SUM('Table'[Value]) 

1.Create a table

vxinruzhumsft_1-1709026412883.png

2.Then create a measure

MEASURE =
VAR _a =
    CALCULATE ( [Sum], 'Table'[Month] IN VALUES ( 'Table (2)'[Type] ) )
RETURN
    IF (
        SELECTEDVALUE ( 'Table (2)'[Type] ) <> "Var",
        _a,
        VAR _b =
            MAXX (
                FILTER (
                    ALLSELECTED ( 'Table (2)' ),
                    [Index]
                        = ( MAX ( 'Table (2)'[Index] ) - 1 )
                ),
                [Type]
            )
        VAR _c =
            CALCULATE ( [Sum], 'Table'[Month] = _b )
        VAR _d =
            MAXX (
                FILTER ( ALLSELECTED ( 'Table (2)' ), [Index] = MAX ( 'Table (2)'[Index] ) - 2 ),
                [Type]
            )
        VAR _e =
            CALCULATE ( [Sum], 'Table'[Month] = _d )
        RETURN
            _c - _e
    )

3.Put the following field to matrix

vxinruzhumsft_2-1709026498324.png

 

Output

vxinruzhumsft_3-1709026527069.png

Best Regards!

Yolo Zhu

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

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Fara-15 

You can refer to the following solution.

Sample data 

vxinruzhumsft_0-1709026318366.png

Sample measure

Sum = SUM('Table'[Value]) 

1.Create a table

vxinruzhumsft_1-1709026412883.png

2.Then create a measure

MEASURE =
VAR _a =
    CALCULATE ( [Sum], 'Table'[Month] IN VALUES ( 'Table (2)'[Type] ) )
RETURN
    IF (
        SELECTEDVALUE ( 'Table (2)'[Type] ) <> "Var",
        _a,
        VAR _b =
            MAXX (
                FILTER (
                    ALLSELECTED ( 'Table (2)' ),
                    [Index]
                        = ( MAX ( 'Table (2)'[Index] ) - 1 )
                ),
                [Type]
            )
        VAR _c =
            CALCULATE ( [Sum], 'Table'[Month] = _b )
        VAR _d =
            MAXX (
                FILTER ( ALLSELECTED ( 'Table (2)' ), [Index] = MAX ( 'Table (2)'[Index] ) - 2 ),
                [Type]
            )
        VAR _e =
            CALCULATE ( [Sum], 'Table'[Month] = _d )
        RETURN
            _c - _e
    )

3.Put the following field to matrix

vxinruzhumsft_2-1709026498324.png

 

Output

vxinruzhumsft_3-1709026527069.png

Best Regards!

Yolo Zhu

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

 

 

Idrissshatila
Super User
Super User

@Fara-15 ,

 

this is normal because the values in which you're adding it appearing under the column in which month name, so how the matrix work is that for every value in the column it will show the measure values.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.