Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Louis66
Resolver I
Resolver I

Color that change dynamically with Play axis

Hello, I have this scatter chart that shows points for each year (here, points for year 2014), using a Play axis as well :

Louis66_0-1681073359911.png

What I would like to do is have the points for the current year in blue, then year-1 in green, year-2 in yellow, and so on. So next year, my blue points will become green. How can I do this with a measure ?

Regards and thanks for your help,

Louis

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Louis66 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1681178861841.pngvtangjiemsft_1-1681178872436.png

 

vtangjiemsft_2-1681178881139.png

(2) We can create measures.

 

 

Measure = SELECTEDVALUE('Selected date'[Year])
color = SWITCH(TRUE(),
MAX('Base'[Year])='Selected date'[Measure],"red",
MAX('Base'[Year])='Selected date'[Measure]+1,"blue",
MAX('Base'[Year])='Selected date'[Measure]+2,"yellow")

 

 

(3) Set conditional formatting and then the result is as follows.

vtangjiemsft_1-1681180252215.png

 

vtangjiemsft_0-1681180132841.png

 

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Louis66 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1681178861841.pngvtangjiemsft_1-1681178872436.png

 

vtangjiemsft_2-1681178881139.png

(2) We can create measures.

 

 

Measure = SELECTEDVALUE('Selected date'[Year])
color = SWITCH(TRUE(),
MAX('Base'[Year])='Selected date'[Measure],"red",
MAX('Base'[Year])='Selected date'[Measure]+1,"blue",
MAX('Base'[Year])='Selected date'[Measure]+2,"yellow")

 

 

(3) Set conditional formatting and then the result is as follows.

vtangjiemsft_1-1681180252215.png

 

vtangjiemsft_0-1681180132841.png

 

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Louis66
Resolver I
Resolver I

I did try using the following measure :
 
Color =
    SWITCH(
        SELECTEDVALUE('Selected date'[Année]),
        MAX(Base[Année]),"RED",
        MAX(Base[Année])-1,"BLUE",
        "YELLOW"
        )
 
Red is OK, but after that, it switches to yellow (no blue)... any reason ?
 
Louis

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors