Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello good afternoon,
1. I have a sales table called "Prov Sales"
2. it has a Date, SKU, Quantity field
3. I have a Date table:
https://www.sqlbi.com/articles/reference-date-table-in-dax-and-power-bi/#
4. The week starts on Monday and we are consulting week 48 (Nov-23 to Nov-29)
5. I have to add the last sale of each product in the selected week.
5.1. Use LASTNONBLANKVALUE but bring only the last day and there are SKUs that were last sold before the last day of the week.
Prov Units = LASTNONBLANKVALUE ('Date' [Date], SUM ('Prov Sales' [Quantity]))
6. In the example the last sale of each product was:
SKU "100119" -> 2020-11-26 Quantity = 19
SKU "100118" -> 2020-11-29 Quantity = 1
SKU "122336" -> 2020-11-29 Quantity = 2
Total Quantity = 22
With the measure I have, it returns Quantity = 3
How can I make a Measurement that adds up the last sale of each product in the selected week?
With this measure, how could you apply it to a measure with the value of the previous week?
Health and Regards.
Can you
1. show the code for your measure and explain where/how yo intend to use it (what fields/filters there are in the visual, etc.)
2. show a sample of the relevant tables in your model. Or best if you can share the pbix
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
25 | |
18 | |
17 | |
17 | |
16 |
User | Count |
---|---|
29 | |
27 | |
18 | |
14 | |
13 |