Forum Discussion
spagad6263
Post Patron
11 months agoHow to show barch chart FIRST column color?
Hi, I would like to set the first column of the barchart a different color. Below is the DAX but it doesn't work. I hope experts can help to provide advice. Thanks meas_BarColor = VAR Cur...
- 11 months ago
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I assume some of the yearmonth category in the selected period show blank value.
meas_BarColor = VAR CurrentCategory = SELECTEDVALUE ( 'dim_Date'[YearMonth] ) VAR FirstCategory = CALCULATE ( MIN ( 'dim_Date'[YearMonth] ), FILTER ( ALLSELECTED ( 'dim_Date' ), [Sales:] <> BLANK () ) ) RETURN IF ( CurrentCategory = FirstCategory, "#FF0000", "#0000FF" )
Jihwan_Kim
Super User
11 months agoHi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I assume some of the yearmonth category in the selected period show blank value.
meas_BarColor =
VAR CurrentCategory =
SELECTEDVALUE ( 'dim_Date'[YearMonth] )
VAR FirstCategory =
CALCULATE (
MIN ( 'dim_Date'[YearMonth] ),
FILTER ( ALLSELECTED ( 'dim_Date' ), [Sales:] <> BLANK () )
)
RETURN
IF ( CurrentCategory = FirstCategory, "#FF0000", "#0000FF" )
spagad6263
Post Patron
11 months agoYes, Thanks Kim, it works perfectly. I really appreciate your help. You are absolutely amazing!!