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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
AshwinGoyal
New Member

Issues in Line and Clustered Column Chart

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.

thanksExcel-Options.JPGPowerBI-Options.JPG

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

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)

yingyinr_0-1625736885219.png

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

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

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)

yingyinr_0-1625736885219.png

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.
HotChilli
Super User
Super User

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.

Pragati11
Super User
Super User

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

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors