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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
LuisNC
Helper I
Helper I

Data Bars in a Table

Hello Dear Community,

There's something I don't understand about data bars.

In the example below, the total amount of sales is 1,56 M, and the top customer (the list is arranged by total sales) appears to have a bar almost completely filled, with a sales amount of 279 K. The filling is not proportional to the total sales amount right?

What am I missing here?

 

LuisNC_0-1688466383749.png

 

The bar is configured like this:

 

LuisNC_1-1688467154371.png

 

Many thanks in advance 🙂

 

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

Hi @LuisNC ,

When you set the conditional formatting with data bars, you can only set the maximum and minimum values, you can't set them as percentages. So we need to create a percentage column and then set the conditional formatting for it. I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a measure as below to get the percent of per customer 

Percent = 
VAR _allamount =
    CALCULATE ( SUM ( 'Table'[Amount] ), ALL ( 'Table' ) )
RETURN
    DIVIDE ( SUM ( 'Table'[Amount] ), _allamount )

2. Add the new measure on the visual and configure conditional formatting for it as below screenshot

vyiruanmsft_1-1688622891112.png

If the above one can't help you, please provide some raw data in your tables(exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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
LuisNC
Helper I
Helper I

Sorry @v-yiruan-msft for my very late reply, and thank you very much for your reply.

The only "problem" is that the table of the example is taking a bit of space already in the report page.

So I don't want to add a new column. From your explanation I understand that it's not possible to create the proportional bar in the total amount column, as an extra column is required.

However I really appreciate your explanation, which makes sense despite I am a newbie in the world of data 🙂

I understand your explanation and your code, and it will be helpful in the future for sure!

Thank you very much again, and all the best!

v-yiruan-msft
Community Support
Community Support

Hi @LuisNC ,

When you set the conditional formatting with data bars, you can only set the maximum and minimum values, you can't set them as percentages. So we need to create a percentage column and then set the conditional formatting for it. I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a measure as below to get the percent of per customer 

Percent = 
VAR _allamount =
    CALCULATE ( SUM ( 'Table'[Amount] ), ALL ( 'Table' ) )
RETURN
    DIVIDE ( SUM ( 'Table'[Amount] ), _allamount )

2. Add the new measure on the visual and configure conditional formatting for it as below screenshot

vyiruanmsft_1-1688622891112.png

If the above one can't help you, please provide some raw data in your tables(exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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