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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
wonka1234
Helper III
Helper III

How to Create Top Line in Line and Stacked Column

hi all,

 

kind of stuck here - how I can create a top line that goes across the top of my stacked bars?

 

wonka1234_0-1740693608977.png

 

 

sample data

 

DateBusiness
OctA
OctA
OctB
NovB
NovA

 

where date is my x axis

count of business is my y-axis

and business is my column legend.

 

Is this a measure I need for my "Line y-axis" . I have trouble creating it as my "business" column is a string.

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@wonka1234 Just add Count of Business to Line Y-axis?

Greg_Deckler_0-1740694239636.png

 



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

5 REPLIES 5
wonka1234
Helper III
Helper III

To update - what worked for me was doing what @Greg_Deckler  said. But i had to remove my filter then re add it.

wonka1234
Helper III
Helper III

@Greg_Deckler  when i do that my graph looks like this - 

 

wonka1234_0-1740751513909.png

 

EDIT - Ah i think I have a filter thats causing the above. When i remove it, i get what you get. However I want to keep the filter. Can I exclude the line data from the filter in any way?

 

Anonymous
Not applicable

Hi @wonka1234 ,

 

You can try code as below.

Line Value =
COUNTX ( ALLEXCEPT ( 'Table', 'Table'[Date] ), [Business] )

 

Best Regards,
Rico Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@wonka1234 You could create a measure like: Line Value = COUNTX( ALL( 'Table' ), [Business] )



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...
Greg_Deckler
Community Champion
Community Champion

@wonka1234 Just add Count of Business to Line Y-axis?

Greg_Deckler_0-1740694239636.png

 



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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors