Forum Discussion

learner03's avatar
learner03
Icon for Post Partisan rankPost Partisan
3 years ago

Text Measure as legend in Pie chart

I have a table, through which it calculates Month's cover of Stock. 

For this the user inputs the Number of Months as a variable  and I have used what if parameter for this. So, if user enters 3 , it calculates sum of last 3 months of sales and  divide current stock on hand by the sum of last 3 months sales  to give Number of month's cover.

Now I need to create Pie chart of  this depending on the Month's cover calculation. So if the answer is between 0-5 then pie chart slice is green, if month's cover is 6-10 then yellow and above that it should be red..

 

All my month's cover, sum of sales are measures. I can't get how to make a legend on pie chart based on 0-5,6-10 and greater that 10 for this.

 

7 Replies

  • I don't think you can use measures in the legend. But you can create a measure for each of the groups and add each measure to the Values section.

      • chengshufang's avatar
        chengshufang
        New Member

        You need to create a column by clicking the 3 dots next to your table, choose "New column". You will see a window appears like when you create a new meausre. Put in: newcolumn = tablename[meausername]

        Choose your pie char, drag the newcolumn to Legend and Values. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi learner03 ,

     

    Here's a possible idea.

    You can create a seperate table for the range.

    Use the SWITCH function to judge the different results of fan'h.

    Measure = SWITCH(MAX('Table (2)'[Legend]),"0-5",[Expression1],"6-10",[Expression2]))

                                                                                                                                                             

    Best Regards,

    Stephen Tao

     

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

    • learner03's avatar
      learner03
      Icon for Post Partisan rankPost Partisan

      Anonymous I used this approach from one of the videos and could create the chart, but there is a table underneath it which has details about items associated with customers. I also have slicers to select customers. The working should be when I click on a particular slice of pie chart, the data should be filtered or other ay around,when I click on particular slicer filter for customer the pie chart should change. This link is not happening as I do not have common column to connect.

  • Nil's avatar
    Nil
    Frequent Visitor

    Hi there,

    Have you got the solution?

    I am having the same issue

    Thank you