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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Show only two colors on chart

I have a table that contains fields: company name, sales, date, rating. And a time table to her. There is also a time slicer that sets the beginning and end of the period.
I want to show on the chart the rating in comparison for two periods (the beginning and the end from the slicer). However, if I change the borders of the slaser, then the "color" of one of the columns is automatically changed. I want the two colors to stay the same (eg blue and green) no matter how the slicer moves.
Can someone tell / show how to do this?
Attached a file with an example.https://1drv.ms/u/s!AkdBRPknhBwvgqhZvHcgtU7aSoLzcA?e=PedTjV 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create two measures for min date and max date.

min_ = CALCULATE(SUM('table'[Sales]),FILTER('table','table'[Date]=MIN('Date Table'[Date])))

max_ = CALCULATE(SUM('table'[Sales]),FILTER('table','table'[Date]=MAX('Date Table'[Date])))

 Then create a visual as below.

10.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create two measures for min date and max date.

min_ = CALCULATE(SUM('table'[Sales]),FILTER('table','table'[Date]=MIN('Date Table'[Date])))

max_ = CALCULATE(SUM('table'[Sales]),FILTER('table','table'[Date]=MAX('Date Table'[Date])))

 Then create a visual as below.

10.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

Thanks it that i need.

But in this case if dont have date in table1 ( that in slicer of date table), then it is not shown on chart.  Can measure take nearly date ?

( For example if in slicer period( from 01.03.2021 to 10.03.2021),and in table  in 03.2021  is near date 02.03.2021, than it show on chart: 02.03.2021 and 10.03.2021.

Any idea?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.