Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi All
I'm new to powerBI and would like to build a dashboard of multiple stage of aggregated data.
Can somebody help on how to do this.
Here's the data I have:
1. ITEM Stock data in every store on daily basis
The Raw data is on the left table while the right one (bold font) is calculated
The calculation I want is I'd like to evaluate how many item is not out of stock on daily basis, and then I'd like give a score later on if the store manage to keep above certain threshold (in this case 75%) on 5 days average.
Store AA | Stock | Availability (if stock>0, 1 else 0) | |||||||||||
ITEM | Day1 | Day2 | Day3 | Day4 | Day5 | Day1 | Day2 | Day3 | Day4 | Day5 | Average | Availability Score (if average >=0.75,1, else 0) | |
A | 1 | 0 | 3 | 1 | 0 | 1.0 | 0.0 | 1.0 | 1.0 | 0.0 | 0.6 | ||
B | 2 | 0 | 1 | 0 | 0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.4 | ||
C | 2 | 0 | 5 | 3 | 1 | 1.0 | 0.0 | 1.0 | 1.0 | 1.0 | 0.8 | ||
D | 8 | 6 | 3 | 4 | 2 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | ||
E | 9 | 7 | 8 | 8 | 8 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | ||
F | 1 | 0 | 3 | 3 | 2 | 1.0 | 0.0 | 1.0 | 1.0 | 1.0 | 0.8 | ||
G | 5 | 3 | 2 | 0 | 0 | 1.0 | 1.0 | 1.0 | 0.0 | 0.0 | 0.6 | ||
AVERAGE TOTAL STORE | 1.00 | 0.43 | 1.00 | 0.71 | 0.57 | 0.74 | 0.0 |
Store BB | Stock | Availability (if stock>0, 1 else 0) | |||||||||||
ITEM | Day1 | Day2 | Day3 | Day4 | Day5 | Day1 | Day2 | Day3 | Day4 | Day5 | Average | Availability Score (if average >=0.75,1, else 0) | |
A | 2 | 0 | 10 | 6 | 3 | 1.0 | 0.0 | 1.0 | 1.0 | 1.0 | 0.8 | ||
B | 2 | 0 | 8 | 4 | 2 | 1.0 | 0.0 | 1.0 | 1.0 | 1.0 | 0.8 | ||
C | 3 | 1 | 8 | 5 | 1 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | ||
D | 7 | 2 | 5 | 5 | 2 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | ||
E | 1 | 0 | 3 | 3 | 8 | 1.0 | 0.0 | 1.0 | 1.0 | 1.0 | 0.8 | ||
F | 2 | 5 | 9 | 7 | 2 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | ||
G | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | ||
AVERAGE TOTAL STORE | 0.86 | 0.43 | 0.86 | 0.86 | 0.86 | 0.77 | 1.0 |
2. Aggregate of store's score to area level
AREA 1.1 | |
STORE | Availability Score |
AA | 0 |
BB | 1 |
CC | 0 |
DD | 1 |
EE | 1 |
Average TOTAL AREA SCORE | 60% |
3. Region score table
REGION 1 | SCORE |
AREA 1.1 | 60% |
AREA 1.2 | 80% |
AREA 1.3 | 92% |
Any advice on how to those above is greatly appreciated..
Thanks in advance
Solved! Go to Solution.
Hi, @wlljhn
Thank you for your feedback.
Please check the below picture and the sample pbix file's link down below, that I fixed.
All measures are in the sample pbix file.
I only have the information of AA and BB, and I do not have CC, DD, EE, 1.2, 1.3
https://www.dropbox.com/s/jpap9hr0jeam9sp/wlljhn.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: https://www.linkedin.com/in/jihwankim1975/
Thanks @Jihwan_Kim ..
Yes this is spot on.. However, I tried to build the dashboard with the actual data that is quite massive (up to 50million data) using the same logic and the SUMX seems to take a while to load. Any suggestion on this issue?
Hi, @wlljhn
Thank you for your feedback.
In that case, I think you can check via the Performance Analyzer.
In my sample pbix file, there are not many things to check because it contains just a few lines in the data.
Thank you.
Hi, @wlljhn
Please correct me if I wrongly understood your question.
I am not sure how your data model looks like, but if I may suggest, I prefer to have the structure of the table like below.
Please check the below picture and the sample pbix file's link down below, whether it is what you are looking for.
All measures are in the sample pbix file.
https://www.dropbox.com/s/jpap9hr0jeam9sp/wlljhn.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: https://www.linkedin.com/in/jihwankim1975/
Hi @Jihwan_Kim
thanks for the advice. yes the data structure in the table is correct, however the measure I want is slightly different. I think I may have confused the illustration I provided earlier with a wrong calculation.
The aggregation step I want is as follow:
1. on item level, if the value is not zero, then I will mark it as 1
2. on day level, I want to see out of 7 item, how many of them are available.
in this case store AA on day 1 100% of the item available, 43% on day 2 and so on.
3. I then want to assign a score again, that in a day, I can only allow 25% of the item with zero stock (or having 75% item available).
so store AA day 1 score is 1 (100%>75%), day 2 score is 0 (43% < 75%).
In 5 days, max possible score is 5 (5 points if store AA can maintain >75% availability for the whole 5 days)
4. then I want to give another score for store that scored at least 75% of the max possible point.
in this case store AA only get 40% (2 days out of possible 5 days with stock > 75%) and store BB get 80% (4 days out of possible 5 days with stock >75%)
5. then on AREA level, I want to see how many store that achieved also at least 75% of the total store within the area. Let's say AREA 1.1, there are 3 stores out of 5 stores that comply, hence for the Area level, AREA 1.1 only score 60%.
Hi, @wlljhn
Thank you for your feedback.
Please check the below picture and the sample pbix file's link down below, that I fixed.
All measures are in the sample pbix file.
I only have the information of AA and BB, and I do not have CC, DD, EE, 1.2, 1.3
https://www.dropbox.com/s/jpap9hr0jeam9sp/wlljhn.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: https://www.linkedin.com/in/jihwankim1975/
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
82 | |
66 | |
61 | |
46 | |
45 |