Power BI DAX & Visualizations: Calculated String Measures to State and Color Visual’s Value, Label and Title





The DAX formula codes suggested in the Video are : 


1). Avg BP (Joint) Status = 

        SWITCH(

            TRUE(),

            [Average Systolic BP(Visual Total)] >=[Systolic_Max] || [Average Diastolic BP (Visual Total)]>=[Diastolic_Max], "Hypertnsion",

            [Average Systolic BP(Visual Total)]<[Systolic_Max] && [Average Systolic BP(Visual Total)] >[Systolic_Min] 

                && [Average Diastolic BP (Visual Total)]<[Diastolic_Max] && [Average Diastolic BP (Visual Total)] >[Diastolic_Min], "Normal",

             [Average Systolic BP(Visual Total)]<=[Systolic_Min] || [Average Diastolic BP (Visual Total)]<=[Diastolic_Min] , "Low BP"

        )


2). Avg BP (Joint) Colour = 

        SWITCH(

            TRUE(),

            [Average Systolic BP(Visual Total)] >=[Systolic_Max] || [Average Diastolic BP (Visual Total)]>=[Diastolic_Max], "#ff0000",

            [Average Systolic BP(Visual Total)]<[Systolic_Max] && [Average Systolic BP(Visual Total)] >[Systolic_Min] 

                && [Average Diastolic BP (Visual Total)]<[Diastolic_Max] && [Average Diastolic BP (Visual Total)] >[Diastolic_Min], "#73D100",

             [Average Systolic BP(Visual Total)]<=[Systolic_Min] || [Average Diastolic BP (Visual Total)]<=[Diastolic_Min] , "#ffa500"

        )


3). Avg Blood Pressure (Jointwithstatus) = 

    FIXED([Average Systolic BP(Visual Total)],1)

        &"/"

            &FIXED([Average Diastolic BP (Visual Total)],1)

                &" ("

                    &[Avg BP (Joint) Status]

                        &")" 


Comments

Popular posts from this blog

Power BI DAX Formula for Dynamic Ranking Calculations Based on User Selections and Filters

Power BI DAX and Visualizations: Active employees across time (as x-axis) by Tenure group or age group

Excel VBA Tips: A Macro to Generate Line Chart Dynamically for Loan Schedule Trend Report