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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Group values in column chart/bar chart

Hey All,
I want to grop the blanks value to another bar. Is it possible?
For example, I want that blanks will be counted with code 9. So blank will be removed from the chart and 9 will show 292 + 5 = 297.

2019-04-03 12_40_45-Window.png

 

Cheers!

1 ACCEPTED SOLUTION

Hi @Anonymous ,

By my tests, the solution of parry2k should be helpful.

I have made a test pbix to reproduce your scenario.

Capture.PNG

In addition, you could have a reference of the attachment.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
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

12 REPLIES 12
Ashish_Mathur
Super User
Super User

Hi,

In the Table where you have dragged the Codes from, create this calculated column formula

=IF(ISBLANK(Data[Codes]),9,Data[Codes])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur ,
Thanks.

This was the first solution from @parry2k .

Please read previous comments.

Thanks

Hi @Anonymous ,

By my tests, the solution of parry2k should be helpful.

I have made a test pbix to reproduce your scenario.

Capture.PNG

In addition, you could have a reference of the attachment.

Best  Regards,

Cherry

 

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

@Anonymous I'm you surely checked this but can you use your actual data on x-axis and check if your see (blank) on x-axis or space/nothing, wondering if it is actually not blank but some other non-printed character value, although that would have been captured in switch statement.

 

Just trying to think out of the box even it is not logical.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Anonymous you can add another column and use that on x axis

 

New Code = IF( ISBLANK(Table[Code]), 9, Table[Code] )

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hey,

That is more or less what I have done, but it is not working.
Thia is my DAX:
Code =
IF(ISBLANK(Table[CODE]), "9",
IF(Table[CODE] = "1", "1",
IF(Table[CODE] = "2", "2",
IF(Table[CODE] = "3", "3",
IF(Table[CODE] = "4", "4",
IF(Table[CODE] = "9" , "9",
"Unknown")
)))))

@Anonymous did you tried what I sent? Not sure why you have to have more if condition, i think ask is if blank then 9 else whatever the code value is, isnt it?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hey @parry2k ,

Not accurate.

I am trying to map the codes to readable values. Sorry, I cannot write the real values due to sensetive data.

I am using numbers here just to ilustrate.

So, if code is 1, show text_1,

if code is 2, show text_2

...

if code is 9 or blank, show text_9

 

So the users can read the values and not guess what is the meaning of each code.

 

Ta!

@Anonymous interesting, you can use switch statement, easy to work with

 

Switch ( Table[Code] ,
1, "Whatever text",
2, "Whatever text",
9, "text for 9",
"text for 9" --this will be final condition if nothing matches above and blank will fall here
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k 
Although switch and if are the same, from logical perspective, I tried to use switch.
I am still with the same results.
New Code =
SWITCH(Table[CODE],
"1", "Text_1",
"2", "Text_2",
"3", "Text_3",
"4", "Text_4",
"9", "Text_9",
"Text_9")


For some reason Power BI is not catching these blanks. Not sure why though.

 

Thanks!

@Anonymous can you share visual like before using with new code on x axis

 

if possible, please share pbix, remove any sensitive information, we are surely missing something here.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi @parry2k 
I tried to export to csv the data, but clearly it works there and the visual shows correctly.

My original dataset is a Firebird DB.

Not sure how to share the PBIX without revealing the data.

Ta!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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