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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
amcneil32
Frequent Visitor

group by and show a distinct value count

Hello, I need to group by and show a distinct value count. 

 

amcneil32_0-1622148864423.png

 

 

For the field "Cust_Subsegment" i would want as a result something like this

 

amcneil32_1-1622149046614.png

 

I've grouped by the distinct row count aggregate, but it looks like its just giving me the total row count for each distinct row. I need a count on the distinct values instead. thanks  

 

amcneil32_2-1622149285446.png

 

 

1 ACCEPTED SOLUTION
amcneil32
Frequent Visitor

@Anonymous , i probably didn't  ask the question very well. I need to return all non-duplicate values. So from above I would need to return only 10199-MEM and  10199-NAS. I came up with a solution that appears to work. I first removed duplicates from the Merged field, which still returns one record for 1000269-TUL. I then duplicated the field, split by delimiter to get the number from the string. After that i just kept the duplicates on the number value.

 

amcneil32_0-1622210423695.png

 

amcneil32_1-1622210439546.png

 

amcneil32_2-1622210454543.png

 

 

amcneil32_3-1622210477960.png

 

 

View solution in original post

2 REPLIES 2
amcneil32
Frequent Visitor

@Anonymous , i probably didn't  ask the question very well. I need to return all non-duplicate values. So from above I would need to return only 10199-MEM and  10199-NAS. I came up with a solution that appears to work. I first removed duplicates from the Merged field, which still returns one record for 1000269-TUL. I then duplicated the field, split by delimiter to get the number from the string. After that i just kept the duplicates on the number value.

 

amcneil32_0-1622210423695.png

 

amcneil32_1-1622210439546.png

 

amcneil32_2-1622210454543.png

 

 

amcneil32_3-1622210477960.png

 

 

Anonymous
Not applicable

are you trying to count the number of times Customer Segment appears? if so you could do something like this

distinctcount(name) then you would pull out the segment to the rows and add the distinct count to the values on a matrix viz

 

 

otherwise are you trying to count the uniqe combination of accountnum, name and segment?

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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