The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hey Guys,
I have a Bar Chart with months on the x-axis and i would like to change the colour for those month in which we are current in and for those ones in the future.
So Sep, Okt, Nov, and Dez should be shown in a different colour.
Anyone who knows how to solve this???
Solved! Go to Solution.
Hi, @Anonymous
You can try the following methods. Calculate the numbers for the year and month with calculated columns.
Month = Month([Date])
Year = YEAR([Date])
Measure:
Color = IF(SELECTEDVALUE('Table'[Month])>=MONTH(TODAY())&&SELECTEDVALUE('Table'[Year])>=YEAR(TODAY()),"Red")
Result:
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
You can try the following methods. Calculate the numbers for the year and month with calculated columns.
Month = Month([Date])
Year = YEAR([Date])
Measure:
Color = IF(SELECTEDVALUE('Table'[Month])>=MONTH(TODAY())&&SELECTEDVALUE('Table'[Year])>=YEAR(TODAY()),"Red")
Result:
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey @v-zhangti !
Do you maybe have a similiar Solution for a BarChart with quarterly view???
I tried:
Hi @v-zhangti,
thank you so much! That is working perfectly!
Do you know if i can change the "Red" into a colour-code?
I just tried and yes it is able to just switch "Red" into any colour code that is needed. In my example "#DD5252"
Create a measure to use for the conditional formatting along the lines of:
future dates = IF(MONTH(MAX(Table[Date])) > MONTH(TODAY()) && YEAR(MAX(Table[Date])) >= YEAR(TODAY()), "Red")
Proud to be a Super User!
Paul on Linkedin.
Thanks Paul!
I guess this will go into the right direction, unfortunately there is something wrong with the function and i can´t figure out what it ist...
Should the Table[Date] part refer to my usual calendar table?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
248 | |
124 | |
111 | |
78 | |
78 |