Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I've created a chart which shows based on user date slicer 3 previous years. So if user select May 2022 then it shows May 2020-2022
I want the every bar to have its own color always. So the smallest number in date always color X (2020), medium color Y (2021), biggest color Z (2022). If user select May 2020 then 2018 - X color, 2019 - Y color, 2020 - Z color
Is it something to achieve? Every bar should have separate color (the same) despite the selection
Solved! Go to Solution.
Hi, @Pbiuserr ;
1.create a new table as slicer date.
slicer = VALUES('Table'[date])
2.create a flag measure ,then apply it into visual filter.
flag = IF(MAX('Table'[date])<=MAX('slicer'[date])&&YEAR(MAX('Table'[date]))>YEAR(MAX('slicer'[date]))-3,1,0)
3.create a conditional's measure.
conditional = IF([flag]=1,RANKX(ALLSELECTED('Table'),CALCULATE(YEAR(MAX('Table'[date]))),,ASC,Dense))
4.set condition.
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Pbiuserr ;
1.create a new table as slicer date.
slicer = VALUES('Table'[date])
2.create a flag measure ,then apply it into visual filter.
flag = IF(MAX('Table'[date])<=MAX('slicer'[date])&&YEAR(MAX('Table'[date]))>YEAR(MAX('slicer'[date]))-3,1,0)
3.create a conditional's measure.
conditional = IF([flag]=1,RANKX(ALLSELECTED('Table'),CALCULATE(YEAR(MAX('Table'[date]))),,ASC,Dense))
4.set condition.
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Requirement is to have X axis Year-Month like 2020 May etc
Colors change when I change selection
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |