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
danextian
Super User
Super User

Show categories which average of certain values is greater than overall average

Hi All,

 

I have a

- table that has these fields:
Department

Cost Center

OT Paid

Measure for sum of OT Paid

 

-a table that shows total headcout for each Cost Center (with relationship to the Cost Center field from the previous table)

-and another thable that shows to the total without any relationship at all with the two the previous tables

 

I created these measures:

Ave OT Paid = Divide( Sum OT Paid, Sum of Headcount) - Headcount from table 2

Ave OT Paid Overall  = Divide(Sumx(All(Table1[Cost Center]),Sum of OT Paid),Sumx(All(Table3[Cost Center]),Sum of Headcount)) - headcount from table 3

OT Paid off CC with Ave Greater Than Overall Ave OT = Calculate(OT Paid, filter(All(Table1[Cost Center]),Ave OT Paid > Ave OT Paid Overall))

 

OT Paid off CC with Ave Greater Than Overall Ave OT would show the correct value if used in a card. However, if used in a table, would show the same value for each row instead of just showing those cost centers with OT Paid/Headcount  is greater than the overall OT Paid/Headcount, and the corresponding OT paid.

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@danextian

 

In this scenario, you have applied the filter context "Ave OT Paid > Ave OT Paid Overall", this filter context is for your calculation only. You can't have it impact the row context in a table visual. If you want to filter those cost centers in your table visual. You can add a tag field like:

 

Tag = IF(Ave OT Paid > Ave OT Paid Overall,1,0)

And use this column in visual level filter or slicer to filtering rows.

 

 

Regards,

View solution in original post

1 REPLY 1
v-sihou-msft
Employee
Employee

@danextian

 

In this scenario, you have applied the filter context "Ave OT Paid > Ave OT Paid Overall", this filter context is for your calculation only. You can't have it impact the row context in a table visual. If you want to filter those cost centers in your table visual. You can add a tag field like:

 

Tag = IF(Ave OT Paid > Ave OT Paid Overall,1,0)

And use this column in visual level filter or slicer to filtering rows.

 

 

Regards,

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.