The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a matrix where I have 2 calculated measure columns:
How do I get the totals as an average rather than the same calculations as the rest of the column?
Try this:
Availability =
VAR MyVar =
IFERROR (
(
SUM ( 'Dates'[Hours] ) - SUM ( 'Reliability Data'[Planned Outage] )
- SUM ( 'Reliability Data'[Unplanned Outage] )
)
/ ( SUM ( 'Dates'[Hours] ) ),
1
)
RETURN
IF (
ISINSCOPE ( 'Reliability Data'[TAG] ),
// [TAG] or any field you will use in your matrix
MyVar,
AVERAGEX ( 'Reliability Data', MyVar )
)
Unfortunately that returns the same results as I currently have in both the column and the total
Then try this:
Availability =
VAR MyVar =
IFERROR (
(
SUM ( 'Dates'[Hours] ) - SUM ( 'Reliability Data'[Planned Outage] )
- SUM ( 'Reliability Data'[Unplanned Outage] )
)
/ ( SUM ( 'Dates'[Hours] ) ),
1
)
RETURN
IF (
ISINSCOPE ( 'Reliability Data'[TAG] ),
// [TAG] or any field you will use in your matrix
MyVar,
MyVar
/ COUNTROWS ( SUMMARIZE ( 'Reliability Data'[TAG], 'Reliability Data'[SYSTEM] ) )
)