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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
markusv
Frequent Visitor

Get not selling products in certain store

I am trying to get information about products which are not selling in one of the stores

Tables which i have:

  • Stores - id, name
  • Invoices - date, store_id
  • InvoiceRows - invoice_id, product_id, amount
  • Products - id, name
  • Stock - product_id, store_id, amount

I also have a slicer attached to Invoices.date.

I am also thinking about adding a what-if slicer to take into consideration how much stock there is left in store. For example if there is less than 5 pieces in stock, then do not show it.

Sounds like a fairly simple problem, but for some reason it is not. I made a matrix table with rows Stores.name, Products.name

NoSales = CALCULATE(SUM('InvoiceRows'[amount]) = 0) this returns true or false whether there was any sales or not. 
I have tried writing various combinations of FILTER() AND CALCULATE() functions but the only gain was that I have probably seen all the error messages there are in DAX. Can anyone guide me in the right direction?
 
Would be also cool to have two tables, one which shows not selling products and when I click on the product then other table shows stores which sell the most of this product.
 
1 ACCEPTED SOLUTION

@amitchandak, Thank you for your reply. The measure you recommended gives a syntax error because of comma after SUM function. Even if it did work I cannot figure out how it would help me. It would just show me products with sales greater than 5. Also I do not have Store Id on Invoice Row.
I appreciate the help but did you even read the question?

Anyway I figured out how to show only the products which are not selling, I have to use "Show items with no data" option and then filter to show blanks and use filter on stock amount to show not selling items with desired stock amount.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@markusv , Create a measure like this and check that is greater than 5 in the visual level filter

 

SUM('InvoiceRows'[amount]), filter(allselected('InvoiceRows'), [Store ID] = max([Store ID]) ) )

@amitchandak, Thank you for your reply. The measure you recommended gives a syntax error because of comma after SUM function. Even if it did work I cannot figure out how it would help me. It would just show me products with sales greater than 5. Also I do not have Store Id on Invoice Row.
I appreciate the help but did you even read the question?

Anyway I figured out how to show only the products which are not selling, I have to use "Show items with no data" option and then filter to show blanks and use filter on stock amount to show not selling items with desired stock amount.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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