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
tiez11
Frequent Visitor

Show "Average" in the "Total" column of a Table.

Hello,

 

I've already searched for possible solutions in other topics, but all of those don't seem to work with the measure that I use. I want to show the average for each column (see screenshot). The percentages are the uptime for each device.

 

Screenshot_1.png

 

The measure that I use is:

 

 

Recalculated Availability = IF(ISBLANK(SUM(fact_data[Downtime BH])),1,DIVIDE(SUM(dim_calendar[WorkingHours])-SUM(fact_data[Downtime BH]),(SUM(dim_calendar[WorkingHours]))))

 

 

I hope you guys can help me!

Thanks in advance. 

 

(I can't share the PowerBi file.)

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

You can try the measure

Recalculated Availability =
var _table =
SUMMARIZE(fact_data, fact_data[Serial No.], "_RA", IF(ISBLANK(SUM(fact_data[Downtime BH])),1,DIVIDE(SUM(dim_calendar[WorkingHours])-SUM(fact_data[Downtime BH]),(SUM(dim_calendar[WorkingHours])))))
Return
AVERAGEX(_table, [_RA])



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

Proud to be a Super User!





View solution in original post

4 REPLIES 4
jgeddes
Super User
Super User

You can try the measure

Recalculated Availability =
var _table =
SUMMARIZE(fact_data, fact_data[Serial No.], "_RA", IF(ISBLANK(SUM(fact_data[Downtime BH])),1,DIVIDE(SUM(dim_calendar[WorkingHours])-SUM(fact_data[Downtime BH]),(SUM(dim_calendar[WorkingHours])))))
Return
AVERAGEX(_table, [_RA])



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

Proud to be a Super User!





Thanks for your answer, the calculation is now done the right way but almost all of my serial numbers dissapear and I have blanks?

 

tiez11_0-1664287268685.png

 

Do you have serial no information in your fact_data table? If so try that field in the measure instead of the assets table.




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

Proud to be a Super User!





There is serial information in the fact_Data table, but "all" the serials are in a dim table (Assets), from that table I select the "Serial No." field. This so, because my fact data contains ticketdata and if for some serial number there is no "ticket", it will not come back in the uptime table (no ticket means 100% uptime for the serial number therefore the ISBLANK in the measure).

 

EDIT: As the situation as described above required a many to many relationship (not ideal, messy data...) I've changed the cross filter direction between the tables and I get the correct output now with your measure. Therefore I will accept it as the solution! Thanks a lot and have a great day. 

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.