Forum Discussion
Customize legends in a bar chart
Hello lbendlin
Thank you very much, but I'm not sure what you did.
In my case, each bar represents a different metric.
I really appreciate that you did this for me, but I’d like to understand what properties you used to group the bars and how you positioned the legend below each one.
I tried placing the metrics on the x-axis, but I can’t seem to make it work.
Is it possible that I'm using an inappropriate visualization?
Thanks again.
Yeah, don't do that. You will want to let go of the Excel style thinking. Unpivot your data, use sort columns. Make your data work the Power BI way.
Have a look at the file I attached.
- ajdm20071 year agoHelper III
For a better understanding, do you happen to have a youtube link which explain how to approach this.
Thank you gent,
- THuận1 year agoNew Member
me too
- lbendlin1 year agoSuper User
Have a look at the file I attached. Study that. I don't have the skills to produce youtube videos.
- ajdm20071 year agoHelper III
Hello lbendlin
I have created a column in my data table named `days_open`, and here is the Power Query formula I used:
Table.AddColumn(#"Removed Columns2", "days_open", each if [status] <> ">Completed*" and [status] <> ">Completed (No Email)" and [status] <> ">Closed" and [status] <> ">Closed(Survey)*" and [status] <> ">Autoclosed" and [sub_type] <> "Zoom" then if Duration.Days(Date.From(DateTime.LocalNow()) - Date.From([date_entered])) <= 7 then "0-7" else if Duration.Days(Date.From(DateTime.LocalNow()) - Date.From([date_entered])) > 7 and Duration.Days(Date.From(DateTime.LocalNow()) - Date.From([date_entered])) <= 14 then "8-14" else if Duration.Days(Date.From(DateTime.LocalNow()) - Date.From([date_entered])) > 14 and Duration.Days(Date.From(DateTime.LocalNow()) - Date.From([date_entered])) <= 21 then "15-21" else if Duration.Days(Date.From(DateTime.LocalNow()) - Date.From([date_entered])) > 21 and Duration.Days(Date.From(DateTime.LocalNow()) - Date.From([date_entered])) <= 28 then "22-28" else if Duration.Days(Date.From(DateTime.LocalNow()) - Date.From([date_entered])) > 28 then "+ 28 days" else "N/A" else "Completed")I have used a bar chart visualization to show how many tickets are open for each time range. However, for some reason, Power BI is not showing any info, even having tickets inside of the brackets. It's just show the completed ones.
Month: 08
Any idea why this might be happening?
Thank you so much,
- ajdm20071 year agoHelper III
Hello lbendlin
I think I understand what you're trying to say — basically, you put the metrics in a table.
So, are you suggesting that I create these columns in my data?
I'm sorry, but I'm just trying to figure out exactly what you're suggesting I do.
Thank you for your time.
- lbendlin1 year agoSuper User
Yes, reformat your data to fit the Power BI philosophy. When coming from Excel where tons of columns are used you need to unlearn that and unpivot your data into key/Value pairs instead. You can still have your pivots, but these are done in the visuals, not in the raw data.