Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello Experts, @MFelix
I need help to highlight column of Latest Month.
means change column color based on X-axis Values dynamically.
highlite column with selected color where date/month in X-axis is latest/max. below SS is desired result.
I have written below DAX and applied to column color but it changes all bar color with latest.
LatestMonthColumnColor =
VAR maxMonth = CALCULATE( max(CycleDayUnpivot[EndDate1stOfMonth]), ALL(CycleDayUnpivot))
RETURN IF(MAX(CycleDays[EndDate1stOfMonth])=maxMonth, "#EE9771")
Solved! Go to Solution.
@Chirag4370 , Create one measure for Latest Month
LatestMonth = CALCULATE(MAX(CycleDayUnpivot[EndDate1stOfMonth]), ALL(CycleDayUnpivot))
And trying updating second measure
LatestMonthColumnColor =
VAR maxMonth = [LatestMonth]
RETURN IF(MAX(CycleDays[EndDate1stOfMonth]) = maxMonth, "#EE9771", "#DefaultColor")
Proud to be a Super User! |
|
@Chirag4370 Did you add your measure to the conditional formatting of the column color in the format pane?
@Chirag4370 Review the following attached screenshot and DAX formula:
LatestMonth =
CALCULATE(
MAX('financials'[Date]),
ALL('financials')
)
IsLatestMonth =
VAR LatestMonth = MONTH([LatestMonth])
VAR LatestYear = YEAR([LatestMonth])
VAR CurrentMonth = MONTH(MAX('financials'[Date]))
VAR CurrentYear = YEAR(MAX('financials'[Date]))
RETURN
IF(CurrentMonth = LatestMonth && CurrentYear = LatestYear, 1, 0)
@Chirag4370 Hope it works.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
@Chirag4370 , Create one measure for Latest Month
LatestMonth = CALCULATE(MAX(CycleDayUnpivot[EndDate1stOfMonth]), ALL(CycleDayUnpivot))
And trying updating second measure
LatestMonthColumnColor =
VAR maxMonth = [LatestMonth]
RETURN IF(MAX(CycleDays[EndDate1stOfMonth]) = maxMonth, "#EE9771", "#DefaultColor")
Proud to be a Super User! |
|
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
56 | |
38 | |
35 |
User | Count |
---|---|
85 | |
66 | |
59 | |
46 | |
45 |