Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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_wpisu | TypTab | IdTab | Document | Restaurant | Date | Product | ProductGroup | Quantity |
| 3936682592 | 2 | 32155038 | PAR/32322 | Restaurant A | 2022-12-02 | Burger Classic | NAPOJE ZIMNE | 1 |
| 3936682593 | 2 | 32456038 | PAR/32555 | Restaurant A | 2022-12-03 | RedBUll | NAPOJE ZIMNE | 1 |
| 3936682594 | 2 | 33723038 | PAR/33866 | Restaurant A | 2022-12-10 | Burger Classic | NAPOJE ZIMNE | 1 |
| 3936682686 | 2 | 33844038 | PAR/33904 | Restaurant A | 2022-12-10 | RedBUll | NAPOJE ZIMNE | 1 |
| 3936682687 | 2 | 33895038 | PAR/33888 | Restaurant A | 2022-12-10 | Coca Cola 0,2L | NAPOJE ZIMNE | 1 |
| 3936682688 | 2 | 34348038 | PAR/34265 | Restaurant A | 2022-12-12 | Coca Cola 0,2L | NAPOJE ZIMNE | 1 |
| 3936682689 | 2 | 35467038 | PAR/35616 | Restaurant A | 2022-12-18 | Burger Classic | NAPOJE ZIMNE | 1 |
| 3936682690 | 2 | 35948038 | PAR/35989 | Restaurant A | 2022-12-19 | RedBUll | NAPOJE ZIMNE | 1 |
| 3936682691 | 2 | 35951038 | PAR/35994 | Restaurant A | 2022-12-19 | Coca Cola 0,2L | NAPOJE ZIMNE | 1 |
any one?
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.
Stand with Ukraine!
Here is an official way you can support Ukraine financially:
Come Back Alive foundation: https://savelife.in.ua/en/
Thank you!
It;s not work :((( this "SELECTEDVALUE dont work in powerpivot 😞
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.
Stand with Ukraine!
Here is an official way you can support Ukraine financially:
Come Back Alive foundation: https://savelife.in.ua/en/
Thank you!
still not work
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 10 | |
| 5 | |
| 5 |