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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Mokegubshook
Helper I
Helper I

Bar Chart Legend with Parameter

Hello, I want to create bars chart like picture below. My bars chart is made from fields parameter (measure) that is 

[CNTD_Supplier]  --> Distinct of supplier
[CNTD_supplier_file]  --> Distinct of supplier files

Mokegubshook_0-1745599446123.png

 

Both of them will give distinct number of supplier or distinct number of files in everyday if there no legend

Mokegubshook_1-1745599792226.png

 

But I want to color bar base on this condition:

Color By Status = SWITCH(
TRUE(),
[Target] > 0 && [CNT_FILE_ID] = 0, "Not Delivered",
[Target] = 0 && [CNT_FILE_ID] = 0, " No Target",
[CNT_FILE_ID] =[Target], "Delivered By Target",
[CNT_FILE_ID] > [Target], "Deliver More than Target",
"Delivered Less than target"
)

 

Color By completeness = SWITCH(
TRUE(),
[Target] > 0 && [CNT_FILE_ID] = 0, "Not Complete",
[Target] = 0 && [CNT_FILE_ID] = 0, " No Target",
[CNT_FILE_ID] =[Target], "Complete",
[CNT_FILE_ID] > [Target], "Complete",
"No delivery"
)

 

If I select [CNTD_Supplier] (Parameter) It should color the bar by Color By Status or Color By completeness (If it also posible to make this as parameter select) by supplier. For example,please use table below,

 

Supplier A on 1 Jan have target = 1 but send 2 files (Distincy of file ID) --> This should color the bar Color By Status = Deliver More than Target

Supplier A on 2 Jan have target = 1 --> This should color the bar Color By Status = Deliver By Target

My data looklike 

Mokegubshook_2-1745600132356.png

 

My problem is Color By Status got wrong return. It's not return by supplier, it return by file name

Mokegubshook_3-1745601354781.png

 

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Mokegubshook Can you share sample data or a sample pbix file?

 

Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
v-echaithra
Community Support
Community Support

Hi @Mokegubshook 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Regards,
Chaithra.

v-echaithra
Community Support
Community Support

Hi @Mokegubshook ,

We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Regards,
Chaithra.

v-echaithra
Community Support
Community Support

Hi @Mokegubshook ,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Regards,
Chaithra.

Greg_Deckler
Community Champion
Community Champion

@Mokegubshook Can you share sample data or a sample pbix file?

 

Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.