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
Post a Comment