Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Pie Chart from Dynamic Measure

Hi,

 

I'm analyzing e-learning data.

I'm trying to build a visualization based on a measure, that can varies base on filters. With no success yet.

Query 1

In the second query we have the UserId and an overall completion status from the DAX measure:

- %Completed = CALCULATE(DISTINCTCOUNT(Table1[Course Title]) , Table1[Status] in {("Completed")} ) / COUNTA(Table1[Course Title])

- %Not Started = CALCULATE(DISTINCTCOUNT(Table1[Course Title]) , Table1[Status] in {("Not Started")} ) / COUNTA(Table1[Course Title])

- Overall Status = IF(([%Not Started] = 1), "Not Started", (IF(([%Completed]= 1),"Completed", "In Process")))

Query 2

My current visualization are:

No filterCourse title filter appliedmultiple filter applied

The filter used is the course title, however the piechart at the buttom doesn't work because it comes from the Overall status that is a fixed column in the second Query.

The bar graph on the right shows the %Completed by UserID, when equal to 1 the selected course is completed, between  0 and 1 is in Process, when equal to 0 is Not started. This is the closest I got to the result I would like to get.

The ideal solution would be a piechart where the legend is the status and the values are the count of people that have %Completed = 1 (Status=Completed), %Completed = 0 (Status=Not Started) and %Completed between 0 and 1(Status=In Process). How can I count the UserID by filtering a measure? 

 

Thanks 

-Monica

 

2 Replies

  • v-danhe-msft's avatar
    v-danhe-msft
    Microsoft Employee

    Hi Anonymous ,

    I could not understand what is your desired result. Could you please post your desired result and offer some detail information about how to achieve it?

     

    Regards,

    Daniel He

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Daniel,

      I'll try to refrase it.

      In the filter I selected 2 titles, in my real case I have groups of course titles with 50 or more different titles. Now, when I filter two titles I consider a user "completed" only if he completed both the titles. So in this case the piechart should show me that only one person out of 3 "completed" both the corses. (indeed in the bar graph on the right we can see only one that has %completed=1). The other 2 users with %completed=0 are considered "Not Started". In the piechart I should get the 3 status as legent and the count of ID as value, that in this case would be 33,33%Completed and 66,66% Not started. 

       

      For Reference: %Completed = CALCULATE(DISTINCTCOUNT(Table1[Course Title]) , Table1[Status] in {("Completed")} ) / COUNTA(Table1[Course Title])

       

      Thanks for helping!

      Monica