Forum Discussion
tasmiaa
7 years agoAdvocate I
How to color a filled map dynamically
I have the following data: Table with countries, date, and a value Country Value Year USA 3 2016 France 6 2016 Germany 2 2016 USA 1 2017 France 4 2017 Germany 5...
- 7 years ago
I found the solution:
- Keep measure Avg_Val_CurrentYear
- Create a new table-
Table = SUMMARIZE(NATURALINNERJOIN('Table', 'Date'),'Table'[Country],'Date'[Date], "Value", [Avg_Val_CurrentYear] ) - Create a measure on the table for previous yearAvg_Val_PreviousYear = CALCULATE (AVERAGE(Value),ALLEXCEPT ( 'Table', 'Table'[Country], 'Table'[Date]),DateADD('Table'[Date], -1, Year))
- Create a calculated column on the table
Color = If(Value < Avg_Val_PreviousYear, "red", "green") - Create a filled map with the country, value and color
v-frfei-msft
7 years agoCommunity Support
Hi tasmiaa ,
Based on my test, it is not possible to conditional formatting in shape map in power bi.You can come up a new idea about that and add your comments there to improve Power BI and make this feature coming sooner.
https://ideas.powerbi.com/forums/265200-power-bi-ideas
Regards,
Frank
tasmiaa
7 years agoAdvocate I
Thanks, I was actually asking about a filled map and not a shape map, but I was able to figure out the issue. My solution is posted on the thread! :)