简体   繁体   中英

Power BI: Conditional Formating Matrix Visual with data bars

I would like to create a matrix visual like below and add data bars as conditional formating to the " Sales Percentage " Column with different user defined max and min values based on the countries.

I have the following dummy data

Salesperson Country Product Sales Percentage Total Sales
Gina Canada City Bike 0.02 232
Gina Canada Mountain Bike 0.56 2800
Gina Italy City Bike 0.32 213
Gina Italy Mountain Bike 0.21 1050
Gina USA City Bike 0.11 122
Gina USA Mountain Bike 0.43 2150
John Canada City Bike 0.32 333
John Canada Mountain Bike 0.34 442
John Italy City Bike 0.12 2132
John Italy Mountain Bike 0.67 1233
John USA City Bike 0.22 3300
John USA Mountain Bike 0.45 7300
Mary Canada City Bike 0.21 121
Mary Canada Mountain Bike 0.53 2650
Mary Italy City Bike 0.32 213
Mary Italy Mountain Bike 0.12 600
Mary USA City Bike 0.11 123
Mary USA Mountain Bike 0.12 600

The matrix looks like this after showing columns as rows and putting " Sales Percentage " and " Total Sales " as values, Country as columns and Product + Salesperson as rows:

在此处输入图像描述

I can add databars when I right click the Sales Percentage under values but I can only enter one user defined min and max value for the whole " Sales Percentage " column. Is it possible to have different maximum value for data bars based on the Country? For example to create a target value of 35% for Canada , 40% for USA and 50% for Italy . So in other words the data bar would be full when the Sales Percentage for Canada reaches 35% and full when Sales Percentage for USA reaches 40% and so on.

This isn't possible with you current setup. The best you could do to approximate this is as follows.

Create a measure as follows:

% Canada = CALCULATE(SUM('Table'[Total Sales]), 'Table'[Country ] = "Canada") 

Do the same for USA and Italy and then add them as values to your matrix.

在此处输入图像描述

在此处输入图像描述

You can now select individual targets for each country.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM