Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
wlljhn
Regular Visitor

Aggregate Data processing

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 AAStock     Availability (if stock>0, 1 else 0)   
ITEMDay1Day2Day3Day4Day5 Day1Day2Day3Day4Day5AverageAvailability Score (if average >=0.75,1, else 0)
A10310 1.00.01.01.00.00.6 
B20100 1.00.01.00.00.00.4 
C20531 1.00.01.01.01.00.8 
D86342 1.01.01.01.01.01.0 
E97888 1.01.01.01.01.01.0 
F10332 1.00.01.01.01.00.8 
G53200 1.01.01.00.00.00.6 
AVERAGE TOTAL STORE      1.000.431.000.710.570.740.0

 

Store BBStock     Availability (if stock>0, 1 else 0)   
ITEMDay1Day2Day3Day4Day5 Day1Day2Day3Day4Day5AverageAvailability Score (if average >=0.75,1, else 0)
A201063 1.00.01.01.01.00.8 
B20842 1.00.01.01.01.00.8 
C31851 1.01.01.01.01.01.0 
D72552 1.01.01.01.01.01.0 
E10338 1.00.01.01.01.00.8 
F25972 1.01.01.01.01.01.0 
G00000 0.00.00.00.00.00.0 
AVERAGE TOTAL STORE      0.860.430.860.860.860.771.0


2. Aggregate of store's score to area level

AREA 1.1 
STOREAvailability Score
AA0
BB1
CC0
DD1
EE1
Average TOTAL AREA SCORE60%

 

3. Region score table

REGION 1SCORE
AREA 1.160%
AREA 1.280%
AREA 1.392%

 

Any advice on how to those above is greatly appreciated..

 

Thanks in advance

 

1 ACCEPTED 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

 

Picture4.png

 

 

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/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

5 REPLIES 5
wlljhn
Regular Visitor

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.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Jihwan_Kim
Super User
Super User

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.

 

 

Picture2.png

 

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/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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

 

Picture4.png

 

 

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/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.