The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I have been working with excel for many years and i am new to PowerBI. Can some one please help on the below issue i am facing?
My data contains a category column which defines the type of error in each transaction. There are only 4 types of errors. In the visualisation using "Line and clustered column chart", i want to be able to select 3 errors in a line chart and 1 in column chart. In excel it was very easy to do this using the combo chart option and excel itself gave the option of customizing each category into either line or column. But in PowerBI, it does not allow me to customize a specific cateogry. It treats the entire column into a single category.
I have attached screenshots from both Excel and PowerBI.
thanks
Solved! Go to Solution.
Hi @AshwinGoyal ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Create two measure to get the line count(3 categories) and column count(1 category)
Note: Here is a little trick, you can use that one category name as the name of the measure.
line count =
CALCULATE (
COUNT ( 'Table'[Category] ),
FILTER ( 'Table', 'Table'[Category] IN { "error01", "error02", "error03" } )
)
error04 =
CALCULATE (
COUNT ( 'Table'[Category] ),
FILTER ( 'Table', 'Table'[Category] = "error04" )
)
2. Create a line and clustered column chart(Shared Axis: Date Column series: Category Column Values: error04 Line values: line count)
Best Regards
Hi @AshwinGoyal ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Create two measure to get the line count(3 categories) and column count(1 category)
Note: Here is a little trick, you can use that one category name as the name of the measure.
line count =
CALCULATE (
COUNT ( 'Table'[Category] ),
FILTER ( 'Table', 'Table'[Category] IN { "error01", "error02", "error03" } )
)
error04 =
CALCULATE (
COUNT ( 'Table'[Category] ),
FILTER ( 'Table', 'Table'[Category] = "error04" )
)
2. Create a line and clustered column chart(Shared Axis: Date Column series: Category Column Values: error04 Line values: line count)
Best Regards
If you write separate measures of the form:
MeasureError = CALCULATE(COUNT(TableS[category]), TableS[category] = "Error")
for each of the error types, you can pull each measure into the line values well.
---
Alternatively, if you were using the line chart only, just pull category in to the legend well.
HI @AshwinGoyal ,
If I understand your query correctly, Power BI does take a column as a single metric to be represented on the visual.
So if you column has 4 values, it will represent all four values as line or bars. I don't think it is possible in Power BI until you transform your data in someway.
Thanks,
Pragati
Hi Pragati11,
You have understood it correct. Transformation is an option which i want to use as a last resort. I was thinking, i am not aware of some hidden options in PowerBI and wanted to check out with the users in this community if there is an alternate way of achieving this.
Thanks
Ashwin
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
141 | |
109 | |
107 | |
76 | |
61 |
User | Count |
---|---|
276 | |
129 | |
124 | |
100 | |
89 |