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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
CLNersesian
Kudo Kingpin
Kudo Kingpin

DAX Formula Problem

Hi - 

 

I'm using the following DAX formula : 

 

Bookings Amt = CALCULATE(SUM('Sales Transaction'[Ordered Amount]), FILTER('Sales Transaction', 'Sales Transaction'[Ordered Quantity]>0))-'Sales Transaction'[Amt Invoiced]

 

I'm trying to only show values that are not equal to zero, or in another case not negative.

 

To Be Shipped Qty = CALCULATE(SUM('Sales Transaction'[Ordered Quantity]), FILTER('Sales Transaction', 'Sales Transaction'[Ordered Quantity]>=0))-CALCULATE(SUM('Sales Transaction'[Packing Slip Quantity]), FILTER('Sales Transaction', 'Sales Transaction'[Packing Slip Quantity]>=0))

 

I'm not sure what I'm doing wrong - so if anyone has any suggestions, please let me know. I'm not stellar with DAX!!

1 ACCEPTED SOLUTION
BhaveshPatel
Super User
Super User

Hi There,

 

Bookings Amt = CALCULATE(SUM('Sales Transaction'[Ordered Amount]), FILTER('Sales Transaction', 'Sales Transaction'[Ordered Quantity]>0))-'Sales Transaction'[Amt Invoiced]

 

In the first formula, the dark black part is naked column reference and is not valid for aggregations. You should use SUM with the formula.

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

2 REPLIES 2
v-micsh-msft
Microsoft Employee
Microsoft Employee

Hi CLNersesian,

 

Could you please explain a bit about what the errors or issues that you are trying to resolve?

Only showing the DAX formula is not so helpful for us to understand your situations.

For the formula "Bookings Amt ", as BhaveshPatel suggested, DAX would not allow to put a column in a measure.

To have it work, either add a sum function:

Bookings Amt := CALCULATE(SUM('Sales Transaction'[Ordered Amount]), FILTER('Sales Transaction', 'Sales Transaction'[Ordered Quantity]>0))-SUM('Sales Transaction'[Amt Invoiced])

Or create a measure first:

Bookings Amt1 := CALCULATE(SUM('Sales Transaction'[Ordered Amount]), FILTER('Sales Transaction', 'Sales Transaction'[Ordered Quantity]>0))

Then another calculated column to do the minus:

Bookings Amt = [Boolings Amt1] - 'Sales Transaction'[Amt Invoiced]

For the second formula, if they are for the same products, then that is good to go, otherwise, we need to add another filter for different products.

Please reply back if you need any further assistance.

Regards

BhaveshPatel
Super User
Super User

Hi There,

 

Bookings Amt = CALCULATE(SUM('Sales Transaction'[Ordered Amount]), FILTER('Sales Transaction', 'Sales Transaction'[Ordered Quantity]>0))-'Sales Transaction'[Amt Invoiced]

 

In the first formula, the dark black part is naked column reference and is not valid for aggregations. You should use SUM with the formula.

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.