The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
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 ) )
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.
User | Count |
---|---|
65 | |
60 | |
55 | |
54 | |
31 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
46 |