DallasBaba's avatar
DallasBaba
Skilled Sharer
8 months ago

Data Analysis Expressions - Customized Martix Table

This Power BI report display historical trends from 2018–2023 of the Ozone Season Heat Input (MMBtu) across U.S. states and fuel types. It highlight the developement of a customized matrix visual for displaying the Yearly record along with the CAGR %, shared %, and YOY % on a Martix table with a dynamic state slicer for environmental compliance and emissions analysis across states. 

 

This is a continuous project :

1st : Adjusting-Unadjusted-Emissions-with-AI-Solution

2nd : Updated view - 2022 Unadjusted NOx Emissions

 

 

_M KPI_Selector_Value = 
VAR _id      = SELECTEDVALUE ( KPI_MatrixAxis[ID] )
VAR _display = SELECTEDVALUE ( KPI_MatrixAxis[Display] )
VAR _year    = IF ( _id = 1, VALUE ( _display ) )

VAR YearlyTotal =
    CALCULATE (
        [Total HTIOZ],
        REMOVEFILTERS ( 'Unadjusted Annual Unit'[Data Year] ),
        KEEPFILTERS ( 'Unadjusted Annual Unit'[Data Year] = _year )
    ) 

VAR YoY =  [_YOY % HTIOZD Data] 
VAR CAGR = [3Y CAGR HTIOZ]

VAR Share_of_Total = DIVIDE ( [Total HTIOZ], CALCULATE ( [Total HTIOZ], ALLSELECTED ( 'Unadjusted Annual Unit' ) ) )

    
RETURN
SWITCH (
    TRUE(),
    _id = 1, FORMAT(YearlyTotal,"#,##"), 
    _id = 2,  YoY , --FORMAT(YoY,"0.0%"),
    _id = 3,  CAGR, -- FORMAT(CAGR,"0.0%"),      
    _id = 4,   FORMAT(Share_of_Total,"0.0%"),  
    BLANK()
)

 

 

 

No RepliesBe the first to reply