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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Conditional shape fill based on date in table

I currently have a table in Power BI that has two columns, a column called CWP that contains names (for example 2_1_90).
The second column in the table contains a date.

 

Now I want to add shapes (just Power BI insert shape) that should be linked to the names in the table. So one shape for every name in the table.

 

I want to have these shapes because the color of the shape should changes when the date changes.

So essentially the color should be linked to the shape.

 

What I got now is the following measure that allows me to conditionally change colors of the name cells in the table:

 
Area_Color =
   SWITCH(MAX(
      'Dummy'[Date].[Month]),
      "January", "Red",
      "February", "Blue",
      "October", "Green",
      "November", "Yellow",
      "December", "Orange",
      "Default Color"
   )
 
This measure is linked to the table and it fills in the CWP cells accordingly.
Change a date and the color for the individual CWP cell changes accordingly.

This means that the name cells in the table already have the right colors.
All I need to do now is link the shapes to these colors in the table some how.
 
Anyone has suggestions on how to link this?
Or suggestions on how to do this more efficiently?
 
regards,
Julian
1 ACCEPTED SOLUTION

I went to Synoptic Designer for Power BI  and it created the attached SVG for me. (Please unzip before use)

 

lbendlin_0-1702308385592.png

 

 

Use that with the Synoptic Panel visual, or with your own HTML5 visual.

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi IbendIin,

 

Thanks for reaching out.

So I added a picture of what I currently have, it is a dummy file (.pbix which I cannot add here).

It is a very basic recreation of what I have:
- a plotplan with multiple areas

- a table with the area names and dates

- a shape (I want to cover all the individual areas with individual shapes and the shapes should be coloured based on the date linked to the area name in the tabel. Colors based on conditional formatting which I did with a measure, see measure in original message)

 

How can I link a shape to the color of the cells in the table?
So I have a working excel file where dates may change, which should then automatically change the color of the cell with the area name. This should then change the color of the shape that is linked to that so that in the overview of the plot plan, the areas change color.

current_status.pngexample plot plan.png

Area nameDate
Meeting Room11/01/2023
Office 111/01/2023
Office 201/01/2024
Office 302/01/2024
Office 412/01/2023

I went to Synoptic Designer for Power BI  and it created the attached SVG for me. (Please unzip before use)

 

lbendlin_0-1702308385592.png

 

 

Use that with the Synoptic Panel visual, or with your own HTML5 visual.

 

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
October NL Carousel

Fabric Community Update - October 2024

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