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
cgoetze
Frequent Visitor

Count/Distinctcount in Columns as a New Table/Visual

Hi,

I need help to Distinctcount and group the result as a simple table.

 

Table Structure:

Table1 
Name - ID
John - X234
John - W567
John - 8910
Maria - W567
Maria - X234
Leo - 2345
Leo - 6789
Leo - X234
Richard - X234
Richard - W567
Richard - 9012
Richard - 6789
Alex - X234
Alex - W567
Alex - 8910
Tiffany - W567
Tiffany - X234
Marc - 2345
Marc - 6789
Marc - X234
Rafael - X234
Rafael - W567
Rafael - 9012
Rafael - 6789

 

Result as Visual (table)

Table A
Count ID - Count Names
2 - 2
3 - 4
4 - 2

 

In other table a range of names in every ID

 

Table B
Range count Names - Count ID
1-3 - 3
4-6 - 2
>7 - 1

 

Thanks.

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @cgoetze ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

vpollymsft_0-1679379595013.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

View solution in original post

5 REPLIES 5
cgoetze
Frequent Visitor

Hello,

 

Thanks!!!

v-rongtiep-msft
Community Support
Community Support

Hi @cgoetze ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

vpollymsft_0-1679379595013.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

cgoetze
Frequent Visitor

Table1
Name - ID
John - X234
John - W567
John - 8910
Maria - W567
Maria - X234
Leo - 2345
Leo - 6789
Leo - X234
Richard - X234
Richard - W567
Richard - 9012
Richard - 6789
Alex - X234
Alex - W567
Alex - 8910
Tiffany - W567
Tiffany - X234
Marc - 2345
Marc - 6789
Marc - X234
Rafael - X234
Rafael - W567
Rafael - 9012
Rafael - 6789

Result:
TableA
Count ID - Count Name (Distinct)
1 - 0
2 - 2
3 - 4
4 - 2
5 - 0

In the table above we have 0 names with 1 ID, 2 Names with 2 IDs....

*The numbers 1 and 5 could be omitted.

In excel i could do a dinamic table with Name in line and count ID in value, and after that a table that "count if" using the dinamic table as source.

Thanks.

 

NameID
John X234
John W567
John 8910
Maria W567
Maria X234
Leo 2345
Leo 6789
Leo X234
Richard X234
Richard W567
Richard 9012
Richard 6789
Alex X234
Alex W567
Alex 8910
Tiffany W567
Tiffany X234
Marc 2345
Marc 6789
Marc X234
Rafael X234
Rafael W567
Rafael 9012
Rafael 6789

 

For TableA

 

cgoetze_0-1678483139276.png

 

For TableB

 

cgoetze_1-1678483582396.png

 

cgoetze
Frequent Visitor

Hi,Is a Statistics Analysis, not so related with business. But I tried my best.

>>>

Data 

VijayP
Super User
Super User

@cgoetze 

This question is bit vague. 

when you create distinct count of both columns answer will not be more than 1 row. Try  to add some data with business perspective and also add why you want to see that!




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


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.