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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Distinct count of ID not working properly in PIE chart.

Hi All,

 

Please help me in solving issue as attached sample data below.

In a pie chart for details selected status column and value field for distinct count of ID. SLicer also existed for date filter.

For example when I selected date range from jan1 to jan9 count should be 3 for closed status based on max date of each ID.

For example when I selected date range from jan1 to jan4 count should be 2 for closed status(for aa ID) and one opened status(for bb ID) based on max date of each ID.

I used calculated measure 

TicketCount = COUNTX(DISTINCT(Sheet2[ID]),MAX(Sheet2[Date])) for distinct count of ID for their max date.
But when selecting date range from jan1 to jan9 it showing 9 count  in pie chart.
table.png

 

 

 

 

 

 

 

 

 

 

Thanks

Praneeth.

5 REPLIES 5
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

You can create a measure below: 

 

TicketCount = CALCULATE(COUNT(Table1[status]), FILTER(ALLSELECTED(Table1),'Table1'[status]=MAX('Table1'[status])))
 
q1.PNGq2.PNG
 
Please see attached pbix file. 
 
Best Regards,
Qiuyun Yu 
Community Support Team _ Qiuyun Yu
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,

 

Still It showing incorrect result, what I was expecting is If we select datarange from jan1 to jan9 then count of ID's should be 3. How means for aa id max date status is closed, b id max date status is closed and cc id max date status is closed so in closed status it want show 3 count. 

 

If we select datarange from jan1 to jan5 then count of ID's should be 2. How means for aa id max date status is closed, bb id max date staus is updated, then it should be show closed staus 1count and updated status 1 count.

 

Thanks

Praneeth

 

Hi @Anonymous,

 

You can modify the measure as below: 

 

TicketCount = var t=SUMMARIZE(ALLSELECTED('Table1'),'Table1'[ID],"maxStatus",var  d= max(Table1[Date])return CALCULATE(max(Table1[status]),Table1[Date]=d))
var s= max(Table1[status]) 
return COUNTROWS(FILTER(t,[maxStatus]=s))

q1.PNGq2.PNG

 

 

For more information, see attached pbix. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
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 All,

 

Please help me in solving issue as attached sample data below.

In a pie chart for details selected status column and value field for distinct count of ID. SLicer also existed for date filter.

For example when I selected date range from jan1 to jan9 count should be 3 for closed status based on max date of each ID.

For example when I selected date range from jan1 to jan4 count should be 2 for closed status(for aa ID) and one opened status(for bb ID) based on max date of each ID.

I used calculated measure 

TicketCount = COUNTX(DISTINCT(Sheet2[ID]),MAX(Sheet2[Date])) for distinct count of ID for their max date.
But when selecting date range from jan1 to jan9 it showing 9 count  in pie chart.
table.png
 
 
 
 
 
 
 
 
 
 

what I was expecting is If we select datarange from jan1 to jan9 then count of ID's should be 3. How means for aa id max date status is closed, b id max date status is closed and cc id max date status is closed so in closed status it want show 3 count. 

 

If we select datarange from jan1 to jan5 then count of ID's should be 2. How means for aa id max date status is closed, bb id max date staus is updated, then it should be show closed staus 1count and updated status 1 count.

 

Thanks

Praneeth

 
 
 
Anonymous
Not applicable

Can any body solve this issue.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.