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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
icrishanka
Frequent Visitor

Calculate grand average from raw average based on time and date filter slisers

Hi,

Please support on following issues,

 

Background : I am working on calculating grand average from raw average which come based sliser selection time renge(Specific) and Date. 

 

Objective : 1. get grand average from Total PA (Total PA change with filter time rage and Date), want to get single value (just show in following table).

2. Calculate grand averge except last obervation after filter range and date (example : except last raw 9/10/2023 4:00:00 PM

icrishanka_2-1697679521619.png

)

3. based on this calculate Control chart. 

Issues is : If I get any missing raw, then I get incorrect result (I found this). 

Refere image 1 : Correct result.

icrishanka_1-1697679042757.png

Refer image 2 : Incorrect result with missing raw. 

icrishanka_0-1697678927750.png

Value 6.72% instead 7.92%.

 

Using following measures : 

 

Total PA =
CALCULATE(
    [Total_Defect]/[Total_Sample]
)
 
AVG =
VAR _AVG =
    CALCULATE(AVERAGEX(SUMMARIZE('06.1._Transaction Time','06.1._Transaction Time'[Time Slot],"ToAVG",[Total PA]),[ToAVG])
)
RETURN _AVG
 
AVG_3 =
VAR G_AVG = CALCULATE(AVERAGEX(SUMMARIZE('05.Calender','05.Calender'[Date],"_PA",[AVG]),[_PA]))
RETURN G_AVG
 
If any one one have any suggestion, please share to me. (Need to calculate control chart excluding last summarized raw as above image). 
 
Thank you
4 REPLIES 4
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

 

Hi Ibendlin,

 

Please find following GooglDrive file (if any issues let me know),

Attached : .pbi (see modeling and allcode)

2 Excel file : 1> Raw data

 2> Expected results calculations.

 

https://drive.google.com/drive/folders/1A1xRARDPxLVfMA9tu2cQtKVfviA-REPl?usp=share_link

 

Thank you very much for your support .

 

Thanks!

Are you sure your timeslots work as designed?

 

lbendlin_1-1698089072505.png

Change your data model slightly

lbendlin_2-1698089125754.png

 

 

Now, if you want to calculate the averages over only the entries with data you'll have to ask someone else to help you. I don't subscribe to that school of thought.

Thank you Ibendlin,

I got a solution without chaning data model. Yup, I think I can manage rest of the parts.

 

Thank you. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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