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
DJsummers
Helper I
Helper I

Calculations using Dataset from SQL

Hi All


Help required and gratefully recieved! I am attempting to create a measure doing:

SUM(CumulativeWeightsView[RecordedWeight]-CumulativeWeightsView[StandardWeight])/CumulativeWeightsView[StandardWeight])

DJsummers_1-1627033102091.png

But it does not work - I can't even minus one value from the other:

DJsummers_2-1627033257382.png

The dataset is from an SQL database so wondering if the relationships are having an effect?

DJsummers_3-1627033347250.png

Let me know if I should have added more info.

Thanks Again
Dan

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @DJsummers 

 

Please try below code:-

Variance = (SUM(CumulativeWeightsView[RecordedWeight])-SUM(CumulativeWeightsView[StandardWeight]))/SUM(CumulativeWeightsView[StandardWeight])

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

2 REPLIES 2
DJsummers
Helper I
Helper I

@Samarth_18 What a dumbo I am!

Thanks very much for the extremely fast response and the second time you've helped me out.
Dan

Samarth_18
Community Champion
Community Champion

Hi @DJsummers 

 

Please try below code:-

Variance = (SUM(CumulativeWeightsView[RecordedWeight])-SUM(CumulativeWeightsView[StandardWeight]))/SUM(CumulativeWeightsView[StandardWeight])

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

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.