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
Anonymous
Not applicable

Filter by an item's total

Hi all, I have an Inventory Stock/Demand table like this:

garynorcross_0-1599849558577.png

That accurately displays the Running Total by Item using a Running Total measure.  How can I filter this table via DAX on items where the Running Total <0?  Currently, if I filter the table by the Running Total measure <0, it filters the table down to individual negative transactions.  What I need is some sort of flag where it only shows items where the Total of the transactions is <0.

7 REPLIES 7
V-pazhen-msft
Community Support
Community Support

@Anonymous 

Try create the measure : 

Measure = 

IF( Calculate([running total measure],Allselected('Table'))<0, [running total measure], Blank())

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thanks @V-pazhen-msft, but unfortunately this did not work.

 

Thinking about this differently, would this work better to create a separate calculated table with just the items where the total <0?  If so, what DAX formula could I use to create this?

Fowmy
Super User
Super User

@Anonymous 

If you do not want to filter the rows for negative values, how do you want to show it? Can you provide and example?

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thanks for the reply - I'm looking to filter the items where the Total is negative, not the individual values.  In the image provided, there are items where the Total (all the way to the right) are <0 - I want to exclude items where the Total is >0 from appearing in the table.

@Anonymous 

Modify the below meaure according to your model

Revised Measure = 

IF( NOT ISFILTERED(TABLE[DATES]) , 
    IF( [Measure] <=0 ,[Measure] , BLANK())
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Anonymous 

I am not sure how your measures are built and the data model. ca you share a PBIX file with some dummy data?

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thanks again for the reply - unfortunately this measure resulted in all values = null or 0.

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.