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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
schlaj
Frequent Visitor

Column Variance

Hello,

 

I have a column across the top of my crosstab that I control the number of columns that show up by a slicer. Ex: state column where the crosstab columns are each state. The measure for the table populates the center of the crosstab, and the rows are various segments of our industry. I want to be able to compare state by state % variances by segment. All fields are in the same table. How would I calculate this? This is an example of what I'm looking for:

Capture.PNG

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @schlaj,

 

I tested with below sample table. Add an index column first, and set its data type to "Whole number".

index Col = RIGHT(Sheet1[State],1)

1.PNG

 

Add below measure and corresponding fields into a Matrix visual.

variance =
VAR previoussteat =
    CALCULATE (
        SUM ( Sheet1[Value] ),
        FILTER (
            ALLEXCEPT ( Sheet1, Sheet1[Segment] ),
            Sheet1[index Col]
                = MAX ( Sheet1[index Col] ) - 1
        )
    )
RETURN
    IF ( previoussteat <> BLANK (), SUM ( Sheet1[Value] ) - previoussteat )
        / previoussteat

2.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @schlaj,

 

I tested with below sample table. Add an index column first, and set its data type to "Whole number".

index Col = RIGHT(Sheet1[State],1)

1.PNG

 

Add below measure and corresponding fields into a Matrix visual.

variance =
VAR previoussteat =
    CALCULATE (
        SUM ( Sheet1[Value] ),
        FILTER (
            ALLEXCEPT ( Sheet1, Sheet1[Segment] ),
            Sheet1[index Col]
                = MAX ( Sheet1[index Col] ) - 1
        )
    )
RETURN
    IF ( previoussteat <> BLANK (), SUM ( Sheet1[Value] ) - previoussteat )
        / previoussteat

2.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-yulgu-msft,

Is there any way that I can make this responsive to a slicer? So if I take out state 2, I can compare State 1 to State 3?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.