Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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 July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
16 | |
8 | |
7 | |
7 | |
6 |
User | Count |
---|---|
23 | |
11 | |
10 | |
10 | |
8 |