The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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] ) )
)