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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
bhuprakashs
Helper I
Helper I

Need column level difference

Hi team,

 

I need a column level difference to show in table metrix. 

current data:

bhuprakashs_0-1764673503673.png


Column level I am using a Category from a table in table metrix. how to show difference between columns like

Economy no change, Basic - Economy , Deluxe - Basic , Premium - Deluxe , Supreme no change

Please help me. Also I am using data source as Live connection so not able to add new table or column so please help a solution of measure only if possible. thanks


1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @bhuprakashs ,

 

If you are using a live connection this is a good option to use visual calculations:

 

Versus previous = [Total Value] - PREVIOUS([Total Value],COLUMNS)

 

The total value is your measure:

MFelix_0-1764674804834.png

 

 

If you don't want to show difference when the value is blank on the last column just redo to:

Versus previous = IF(ISBLANK([Total Value]), BLANK(), [Total Value] - PREVIOUS([Total Value],COLUMNS))

MFelix_1-1764674869057.png

 

 

Check the detail how to use visual calculations:

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-visual-calculations-overview

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @bhuprakashs ,

 

If you are using a live connection this is a good option to use visual calculations:

 

Versus previous = [Total Value] - PREVIOUS([Total Value],COLUMNS)

 

The total value is your measure:

MFelix_0-1764674804834.png

 

 

If you don't want to show difference when the value is blank on the last column just redo to:

Versus previous = IF(ISBLANK([Total Value]), BLANK(), [Total Value] - PREVIOUS([Total Value],COLUMNS))

MFelix_1-1764674869057.png

 

 

Check the detail how to use visual calculations:

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-visual-calculations-overview

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





@MFelix thank you . works fine for me. 

bhuprakashs
Helper I
Helper I

@rohit1991  thanks for help but it is giving me same value. it is not giving me difference value 

rohit1991
Super User
Super User

Hii @bhuprakashs 

 

Since Economy and Supreme should show no change, and the other columns should subtract the previous one, use this pattern:

Column Difference =
VAR Col = SELECTEDVALUE('Category'[ColumnName])
VAR PrevCol =
    SWITCH(
        Col,
        "Basic",    "Economy",
        "Deluxe",   "Basic",
        "Premium",  "Deluxe",
        BLANK()       
    )
RETURN
IF(
    ISBLANK(PrevCol),
    BLANK(),
    CALCULATE([YourValueMeasure])
        - CALCULATE([YourValueMeasure], 'Category'[ColumnName] = PrevCol)
)

Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.