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
Anonymous
Not applicable

Calculated Table & Distinct Count - Help

Hello,

 

I am struggling through something that I'm sure is very simple. I have data 

StoreInvoiceItem
Blue100A
Blue100A
Blue100A
Blue100B
Blue101B
Blue101C
Blue102A
Blue103B
Blue103C
Blue103C
Blue104A
Blue104D
Green200A
Green200B
Green201B
Green201B
Green201C
Green201C
Green202A
Green203B
Green203A
Green204A
Green204A
Green204C

 

What I would like to do, is have the frequency of each occurence pulled in. ie, Blue, 100, & A occurs 3 times, while Blue, 100, & B only  once. I figured I would set up a Calculated Table to summarize, but can't get the summary to work for me. I want my Calculated table to turn out like my visual here.

Capture.PNG

My Code 

Table = SUMMARIZE(Sheet1,Sheet1[Store],Sheet1[Invoice],Sheet1[Item],"Count",DISTINCTCOUNT(Sheet1[Item]))

 is obviously incorrect. Please help. I have the file attached.

 

https://www.dropbox.com/s/jxzfbfqjm5z3y2i/Sample.pbix?dl=0

 

Thanks!

2 ACCEPTED SOLUTIONS
OwenAuger
Super User
Super User

@Anonymous

 

In this case you can just replace

DISTINCTCOUNT ( Sheet1[Item] )

with

COUNTROWS ( Sheet1 )

 

Out of interest, why is it useful to create this as a calculated table (when you can do the same thing with a visual)?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

BhaveshPatel
Community Champion
Community Champion

Hi There,

 

You can also use GROUPBY in the Query Editor for counting the frequency of occurances in this case as shown in the screenshot.GroupByGroupBy

Frequency of occurancesFrequency of occurances

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

3 REPLIES 3
BhaveshPatel
Community Champion
Community Champion

Hi There,

 

You can also use GROUPBY in the Query Editor for counting the frequency of occurances in this case as shown in the screenshot.GroupByGroupBy

Frequency of occurancesFrequency of occurances

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
OwenAuger
Super User
Super User

@Anonymous

 

In this case you can just replace

DISTINCTCOUNT ( Sheet1[Item] )

with

COUNTROWS ( Sheet1 )

 

Out of interest, why is it useful to create this as a calculated table (when you can do the same thing with a visual)?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn
Anonymous
Not applicable

@OwenAuger

 

Thank you. I would like to do this so that I can filter out items that have only one frequency.

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.