Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello all!
I'm not a professional data analyst but I have to analyze the performance of objects we develop pretty often.
I'm very new in Power BI (just finish online training). I need to analyze a big amount of data. I have 400 objects and daily data (20 parameters) for each one for 1.5 years. Excel is not capable to handle this amount. The problem is that I have to calculate one parameter based on another and use its moving average to calculate the 3rd parameter again for every day. I spent already a few days trying to solve the issue but no luck. It is so simple in Excel and so difficult in Power BI.
See the simplified example below:
I have source data like the left table below. Right one what I need to get.
For each date, I have many KPIs for each object. I kept only 2 for simplicity.
I have to:
I found how to calculate Measure (below) but I couldn't use it to calculate daily data for Heat
Eff 8 days M =
calculate (
AVERAGEX(L6,L6[Efficiency]),
DATESINPERIOD(
L6[Date],
LASTDATE(L6[Date]),
-8,DAY
)
)
I also found an example of how to create a column with moving average using index but it was for one Object and if I have many than calculations should be separate for each one
P.S. I wanted to attach excel file but there is no such option.
Also, I was wondering that Moving average Measure calculated for dates didn't work (I plotted on graph) when I wanted to plot it with respect to age calculated for every day based on the date of Object was started
I'd appreciate any help
Solved! Go to Solution.
Hi, @Alegarh24
Based on your description, I created data to reproduce your scenario. I calculated moving average three days for test. You may modify 3 days as 8 days in your measure. The pbix file is attached in the end.
Table:
You may create a calculated column and measures as below.
Calculated column:
Efficiency = [Output]/8/[Power]
Measure:
Efficiency Mov Avg 3 =
CALCULATE(
AVERAGE('Table'[Efficiency]),
FILTER(
ALL('Table'),
'Table'[Object] = SELECTEDVALUE('Table'[Object])&&
'Table'[Date] <= SELECTEDVALUE('Table'[Date])&&
'Table'[Date] >= SELECTEDVALUE('Table'[Date])-2
)
)
Heat = (4-2.1*[Efficiency Mov Avg 3])*SELECTEDVALUE('Table'[Power])
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Alegarh24
Based on your description, I created data to reproduce your scenario. I calculated moving average three days for test. You may modify 3 days as 8 days in your measure. The pbix file is attached in the end.
Table:
You may create a calculated column and measures as below.
Calculated column:
Efficiency = [Output]/8/[Power]
Measure:
Efficiency Mov Avg 3 =
CALCULATE(
AVERAGE('Table'[Efficiency]),
FILTER(
ALL('Table'),
'Table'[Object] = SELECTEDVALUE('Table'[Object])&&
'Table'[Date] <= SELECTEDVALUE('Table'[Date])&&
'Table'[Date] >= SELECTEDVALUE('Table'[Date])-2
)
)
Heat = (4-2.1*[Efficiency Mov Avg 3])*SELECTEDVALUE('Table'[Power])
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a lot! Works perfect
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |