Skip to main content
cancel
Showing results for 
Search instead 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.

Reply
jason_ocp90
New Member

DAX formula for value more than 0

Hi, 

 

I faced the problem of writing the DAX formula to filter out the net saving of the material with more than 0. 
Below is the DAX i wrote for material level.
 
Net Savings > 0 = CALCULATE([Net Savings USD],FILTER(GROUPBY('Raw Material Finance Report','Raw Material Finance Report'[Material.Material Level 01.Key]),[Net Savings USD]>0))
 
However, when I drill down to the next level at component code, the amount for 15116 is not shown as it is a negative number 312,376. Is there anything that I can improve on my existing DAX to get the net saving amount at component level regardless if it is positive or negative?
 

jason_ocp90_0-1708494113806.png

 

Thank you

 

1 REPLY 1
v-yifanw-msft
Community Support
Community Support

Hi @jason_ocp90 ,
Based on your description, it appears that your current DAX formula is filtering out any negative net savings amounts, which is why you are not seeing amounts for component code 15116. To resolve this issue, you may want to consider adjusting your method to ensure that you can view all net savings amounts at the component level while still applying your filters at the material level.
Here is a modified Dax that may help:

 

Net Savings All Levels =
CALCULATE (
    [Net Savings USD_],
    FILTER (
        ALL ( 'Raw Material Finance Report'[Material.Material Level 01.Key] ),
        'Raw Material Finance Report'[Material.Material Level 01.Key]
            IN VALUES ( 'Raw Material Finance Report'[Material.Material Level 01.Key] )
    )
)

Final output:

vyifanwmsft_0-1709519913599.png

 

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

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

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors