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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Tom_McFadyen
Frequent Visitor

Dynamic Difference Column

Hi All,

I am very new to Power BI and I want to make a simple dynamic column that is the difference between my two sources ( 26 - 11).

Any help would be greatly appreciated. 

powerBIHelp.PNG

1 ACCEPTED SOLUTION

Hi @Tom_McFadyen ,

 

Create a measure like so:

 

Diff =
VAR Source26 =
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[SourceID] = 26 )
VAR Source11 =
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[SourceID] = 11 )
RETURN
    Source26 - Source11

 

 

Best Regards,

Icey

 

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

3 REPLIES 3
HashamNiaz
Solution Sage
Solution Sage

Hi @Tom_McFadyen !

 

You can use following DAX to create a new column;

 

New Column = Table[26] - Table[11]

 

Regards,

Hasham

 

Hi Hasham,

 

Unfortunately these aren't individual columns. They are ID's assigned to a normalised row [SecId, SourceID, Value] And I want to calculate the difference between values where secId's are common and calc is SourceID 26 - source ID 11

 

Hi @Tom_McFadyen ,

 

Create a measure like so:

 

Diff =
VAR Source26 =
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[SourceID] = 26 )
VAR Source11 =
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[SourceID] = 11 )
RETURN
    Source26 - Source11

 

 

Best Regards,

Icey

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.