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

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.

Reply
gra_wang
Helper I
Helper I

Quarterly Average over Weekly Average

I'm trying to create a line and clustered chart where the clusters/bars show weekly averages while the lines show quarterly averages.

Graph.JPG
Here is the measure I used to try to get a quarterly average:

Quarterly Average Talk Time =
AVERAGEX(
    SUMMARIZE(subAgentCall,subAgentCall[Quarter],subAgentCall[skill_name],subAgentCall[Call Type],"Average Talk Time",
    (SUM(subAgentCall[SUM TT])/SUM(subAgentCall[Calls Handled]))/60),[Average Talk Time])

Problem is (as indicated by the picture above), all that happens is the line matches the weekly average. Is it possible to create a measure that calculates strictly at the quarterly level and utilize it on a graph using weekly intervals?



1 ACCEPTED SOLUTION

@gra_wang,

 

Drag [Quarter] on top of [Week], and select the third icon "Expand all down one level in the hierarchy" in the top left corner of the visualization.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

 

I am just unable to understand your requirement.  If there are data on the X-axis, then how can you show a line chart for quarters?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I am trying to get the bars to indicate average talk time on a weekly level (which it is already doing), and I am trying to get the line to show the average on a quarterly level. The idea is to compare weekly to quarterly averages.

 

Here is the raw data:

graph2.JPG

 

For weekly average, I just used a simple measure:


Average Talk Time = (SUM(subAgentCall[SUM TT])/SUM(subAgentcall[Calls Handled]))/60

 

then I graphed the measure with the x-axis based on the Week column indicated in the picture above.
Now I want to have the line show quarterly average so I am looking for a measure similar to Average Talk Time, but calculates it on a quarterly level. If a measure is not the best practice, then I am open to other suggestions. Thanks for your response. Hope this clarifies my requirement.

Hi,

 

I cannot appreiate your requirement.  If weeks are shown on the X-axis then how can the line show quarterly averages?  Someone else will help you.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Here's me doing this in Excel (different data set but the same concept):

graph3.JPG

Hopefully that helps?

@gra_wang,

 

You may use ALLSELECTED Function.

ALLSELECTED ( subAgentCall )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I created a measure using ALLSELECTED as you suggested:


Quarterly Average Talk Time =
CALCULATE(
    SUMX(
        SUMMARIZE(subAgentCall,subAgentCall[Quarter],subAgentCall[skill_name],subAgentCall[Call Type],"Quarterly Talk Time",
        (SUM(subAgentCall[SUM TT])/SUM(subAgentCall[Calls Handled]))/60),[Average Talk Time]),ALLSELECTED(subAgentCall[Quarter]))

The result is this:
weekly.JPG
As you can see, I get an abnormally high value for the Quarter Average and it appears to be fixed (the quarterly average should change after 9/24/2017). Can you be more specific as to how I should use ALLSELECTED()?

@gra_wang,

 

Drag [Quarter] to Shared axis as well, and use ALLSELECTED ( subAgentCall[Week] ).

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I have modified the formula for the measure:
Quarterly Average Talk Time =
CALCULATE(
    SUMX(
        SUMMARIZE(subAgentCall,subAgentCall[Quarter],subAgentCall[skill_name],subAgentCall[Call Type],"Quarterly Talk Time",
        (SUM(subAgentCall[SUM TT])/SUM(subAgentCall[Calls Handled]))/60),[Average Talk Time]),ALLSELECTED(subAgentCall[Week]))

 

and I dragged [Quarter] into the shared axis. Unfortunately, I am still not getting the desired result:

graph1.JPG

The line values are different, but I am still getting a constant line instead of a line that changes as the quarter changes.

 

 

@gra_wang,

 

Drag [Quarter] on top of [Week], and select the third icon "Expand all down one level in the hierarchy" in the top left corner of the visualization.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your help thus far.

 

Is there a way to hide the quarter axis label?

 

Here is how my x-axis labels look right now:
quarter week.JPG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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