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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Gareth_Hunt
Helper II
Helper II

DAX Code re-running sub total rather than summing

we have a dax code that runs to calculate revenue variance when we look at the sub total 

the dax code is re running the equation rather than summing the values with in that catagory

 

 CY_QTYPY_QTY CY_REV  PY_REV  CYavgREV  PYavgREV  REV-var 
SuB Total A+B+C150425 £          65,000 £        180,000 £        433 £           424 £        1,471
Product A100350 £          25,000 £          75,000 £        250 £           214 £        3,571
Product B050 £                   -   £          60,000 £            -   £        1,200 £               -  
Product C5025 £          40,000 £          45,000 £        800 £        1,800-£     50,000

CY_Qty PY_Qty and CY_REV and PY_REV are calulated from summarised data table.

CY_avgRev and PY_avgREV are measures that calculate Rev/Qty

REV Var is a measure of sumx (( CY_avgREV - PY_avgREV) * CY_Qty)

 

We have looked through other forums and couldn't find other people with a similar issue and we have looked through the settings for sub totals and none of the changes work!

 

Thanks

 

 

 

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Gareth_Hunt ,

 

Please use SUMX function to have a try.

Measure = SUMX(your_table,the_measure_need_to_be_summed)

 

Best Regards,
Xue Ding
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-xuding-msft
Community Support
Community Support

Hi @Gareth_Hunt ,

 

Please use SUMX function to have a try.

Measure = SUMX(your_table,the_measure_need_to_be_summed)

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AntrikshSharma
Community Champion
Community Champion

It is no clear what you want to do. And your last measure is not a valid one.

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors