cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Krzysiek87
Helper II
Helper II

Availability of the product in the menu

Hi DAX specialists, I have a problem in a restaurant, I am researching a certain sales period, and now I would like to know over the course of, for example: 6 months, how many days a given product was on sale. Based on this availability, what is the average sale per day but in terms of the actual availability of the product (first part of my question). Sample table below I will be much obliged for your help.

 

id_wpisuTypTabIdTabDocumentRestaurantDateProductProductGroupQuantity
3936682592232155038PAR/32322Restaurant A2022-12-02Burger ClassicNAPOJE ZIMNE 1
3936682593232456038PAR/32555Restaurant A2022-12-03RedBUllNAPOJE ZIMNE 1
3936682594233723038PAR/33866Restaurant A2022-12-10Burger ClassicNAPOJE ZIMNE 1
3936682686233844038PAR/33904Restaurant A2022-12-10RedBUllNAPOJE ZIMNE 1
3936682687233895038PAR/33888Restaurant A2022-12-10Coca Cola 0,2LNAPOJE ZIMNE 1
3936682688234348038PAR/34265Restaurant A2022-12-12Coca Cola 0,2LNAPOJE ZIMNE 1
3936682689235467038PAR/35616Restaurant A2022-12-18Burger ClassicNAPOJE ZIMNE 1
3936682690235948038PAR/35989Restaurant A2022-12-19RedBUllNAPOJE ZIMNE 1
3936682691235951038PAR/35994Restaurant A2022-12-19Coca Cola 0,2LNAPOJE ZIMNE 1
5 REPLIES 5
Krzysiek87
Helper II
Helper II

any one?

ERD
Resident Rockstar
Resident Rockstar

Hi. Can you show the result you want to achieve?

If you just want to calculate days, when products were sold, per product:

days = CALCULATE(DISTINCTCOUNT(T[Date]), T[Product] = SELECTEDVALUE(T[Product]))

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

It;s not work :((( this "SELECTEDVALUE dont work in powerpivot 😞

ERD
Resident Rockstar
Resident Rockstar

You can use MAX instead of SELECTEDVALUE.

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

still not work

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors