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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
NBOnecall
Helper V
Helper V

Visual not filtering? (I think it is a relationship issue)

Hi,

 

I am trying to create a visual that will show how many days an item has been out of stock. The out of stock measure is the following.

 

CountDaysOOS = CALCULATE(COUNTROWS(FILTER('Grouped ns vwInventorySnapshot','Grouped ns vwInventorySnapshot'[DetereminedQuantity] =0 && 'Grouped ns vwInventorySnapshot'[Date] > MIN('Grouped ns vwInventorySnapshot'[ns vwFirstDateInStockByLocation.FirstDateInStock]))))

For something I don't understand when putting it into a visualization I get the error that there is too many rows appearing. My item table only has 23k lines. I expexted each row to stay a single row with the OOS column added on. When I do that it gets the error of over 1,000,000 rows of data. I don't know what is exactly going on, but as you can see in the picture below, even filtering for "Not Blanks", it still returns the results. Any help is apperciated.

 

Out of Stock relationship.pngVisual.JPG

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @NBOnecall ,

 

Try this one please.

 

CountDaysOOS =
VAR a =
    MIN ( 'Grouped ns vwInventorySnapshot'[ns vwFirstDateInStockByLocation.FirstDateInStock] )
RETURN
    CALCULATE (
        COUNTROWS ( 'Grouped ns vwInventorySnapshot' ),
        FILTER (
            ALLSELECTED ( 'Grouped ns vwInventorySnapshot' ),
            'Grouped ns vwInventorySnapshot'[DetereminedQuantity] = 0
                && 'Grouped ns vwInventorySnapshot'[Date] > a
        )
    )

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

So this measure did work, but takes 4+ minutes to load one result compared to the one in my first post. The one thing I was getting at was when filtering for quantity sold if blank to not show any results, this didn't do either. So I am confused on why using Quantity sold from the Sales Register table and filtering out, that my Out of Stock measure doesn't allow it to be filtered out. When removing the Out of Stock measure from the visualization and have quantity sold is not blank, the result removes the correct rows, but with Out of Stock in the visual it won't remove it.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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