Forum Discussion

shalini13's avatar
shalini13
Regular Visitor
2 years ago

Quarter data display in bar chart

hi ,

 

I want to display cumulative quarter wise data for the selected quarter in the slicer along with the previous quarter. for an instanace, if i select Q2, then the total sales value for the Q1 & Q2 has to be displayes in the bar chart. Here I used calendar table for slicer. 

this is the dax, i used, 

cumm_bar = CALCULATE
(
           COUNTROWS(PurchaseOrder),
            FILTER
            (
              ALL( CalendarTable),
              CalendarTable[Quarter] <= MAX(CalendarTable[Quarter])
              && CalendarTable[Year] = MAX(CalendarTable[Year])
)). 
in this case, i always get the value for the quarter that i select in the slicer not for the previous ones. please help. TIA.

11 Replies

  • Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

    • shalini13's avatar
      shalini13
      Regular Visitor

      i am looking for similar output. let me try and came back. thanks a ton

  • shalini13's avatar
    shalini13
    Regular Visitor

    Hello ahmed,

     

     can i know how the key is created and a brief explanation about it. please.

    • shalini13's avatar
      shalini13
      Regular Visitor

      This solution doesnt work for me  . i am getting bar only for the selected quarter. 

  • for it to work for you, you must create an unrelated table like I have in the "Slicer" file
    and use it for slicing

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi shalini13 ,

     

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please feel free to let me know.

     

    Best Regards,

    Neeko Tang

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