Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
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
Hello,
I am quite new to PowerBI and this is my first time posting here.
What I am trying to accomplish is to retrieve the sum of all sales that are above a certain day threshold and aggregate these values per week.
I have the following example data:
Sales
| Date | Time | Net sales |
| 1-5-2023 | 13:00 | 100 |
| 1-5-2023 | 14:00 | 50 |
| 1-5-2023 | 15:00 | 70 |
| 2-5-2023 | 12:00 | 150 |
| 2-5-2023 | 16:00 | 30 |
| 3-5-2023 | 10:00 | 200 |
| 4-5-2023 | 11:00 | 160 |
| 4-5-2023 | 11:00 | 10 |
| 5-5-2023 | 13:00 | 80 |
| 5-5-2023 | 14:00 | 150 |
| 5-5-2023 | 15:00 | 20 |
| 6-5-2023 | 15:00 | 170 |
| 7-5-2023 | 12:00 | 190 |
| 7-5-2023 | 16:00 | 40 |
Threshold
| Date | Threshold |
| 1-5-2023 | 150 |
| 2-5-2023 | 190 |
| 3-5-2023 | 250 |
| 4-5-2023 | 180 |
| 5-5-2023 | 150 |
| 6-5-2023 | 200 |
| 7-5-2023 | 200 |
Solved! Go to Solution.
You need a dimensional table for the date to bring both tables together in a model:
Here is the measure, you have to calculated the difference within the dates
Proud to be a Super User!
You need a dimensional table for the date to bring both tables together in a model:
Here is the measure, you have to calculated the difference within the dates
Proud to be a Super User!
Wow, you are fast! Your solution works like a charm. I am not yet familiar with the summarize function of DAX, so i'm gonna try and figure out exactly how the formula works. Thank you very much! 🙂
Enjoy your journey in DAX 🙂
Proud to be a Super User!
You calculated the sum in your var and than you check if the sum is greater as 0.
Proud to be a Super User!
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 |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |