Forum Discussion

wonka1234's avatar
wonka1234
Helper III
1 year ago
Solved

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?

 

 

 

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.

5 Replies

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

     

     

    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?

     

    • Greg_Deckler's avatar
      Greg_Deckler
      Community Champion

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

    • Anonymous's avatar
      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.