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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DAX Query

Hi ..I am new to DAX ... Pls help me.... I have to get the difference of values based on two entries of the same column & time. How can I get the  difference of Telemetry values of SensorID 975425 & 975424 wrspt to time? TIA

@SpartaBI 

DAXdbt.png

1 ACCEPTED SOLUTION

Okay, then you can modify your measure a bit;
Difference=CALCULATE(SUM(Table[Telemetry]),Table[SensorID]="975425") - CALCULATE(SUM(Table[Telemetry]),Table[SensorID]="975424").


Let me know if that helps.

View solution in original post

5 REPLIES 5
SpartaBI
Community Champion
Community Champion

@Anonymousin case I understood what you meant then if you use the measure that @SanketBhagwat sent you and put dates on the axis of the column you will get the differenct per each row in the table visual.
If you want to also see the values for each Sensor on the table you can also add 2 measures and them also to the table.
975425_Value = CALCULATE(SUM(Table[Telemetry]),Table[SensorID]="975425")
975424_Value = CALCULATE(SUM(Table[Telemetry]),Table[SensorID]="975424")




2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

SanketBhagwat
Solution Sage
Solution Sage

Hi @Anonymous .

If dates in both the columns are exact same then I think you can directly calculate the difference between Telemetry columns subject to a active relationship between this 2 tables based on 'Time' Column.

Create a measure as Difference=SUM(Table1[Telemetry])-SUM(Table2[Telemetry])



If this post helps, then mark it as "Accept as Solution"  and give it a thumbs up.


Anonymous
Not applicable

 

Hi Thank you for your response. But I have only one table , where the SensorID field contains the values based on which I have to do the comparison.

ExecuteQuery.png

Okay, then you can modify your measure a bit;
Difference=CALCULATE(SUM(Table[Telemetry]),Table[SensorID]="975425") - CALCULATE(SUM(Table[Telemetry]),Table[SensorID]="975424").


Let me know if that helps.

Anonymous
Not applicable

Thank you @SanketBhagwat . This gives me the sum of value difference. I need to get the row wise difference as in figure 1 ,ie. 370.14-252.15=?, for each row.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.