cancel
Showing results for
Did you mean:

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Frequent Visitor

## Help to define Dax Formula

Hello,

I'm pretty new to using Dax in PowerBI,

I would like to calculate the remaining production qty by calculating (SUM order qty (table 1)) - (SUM production output(table 2)).

rules if the result <0, will be stored as "0" avoid minus.

What Dax formula do I need to use?

Thank you

2 ACCEPTED SOLUTIONS
Super User

measure   =

var s = sum(table_1[order qty_col_name]) - sum(table_2[production_output_col_name])

return

switch(

true(),

s < 0 , 0 , s)

let me know if this works for you .

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

Super User

you wrote var.s(

modify it  to :  var S =

4 REPLIES 4
Super User

measure   =

var s = sum(table_1[order qty_col_name]) - sum(table_2[production_output_col_name])

return

switch(

true(),

s < 0 , 0 , s)

let me know if this works for you .

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

Frequent Visitor

Hi @Daniel29195 , I still got error like this

Super User

you wrote var.s(

modify it  to :  var S =

Frequent Visitor

Thank you

Announcements

#### Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors