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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

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 1Query 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 2Query 2

My current visualization are:

No filterNo filterCourse title filter appliedCourse title filter appliedmultiple 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 2
v-danhe-msft
Microsoft Employee
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

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Daniel,

I'll try to refrase it.

Test2.JPG

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

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.