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

Count of rows based on a column's unique id?

Hi,

 

I'm trying to get a volume based on specific columns. I have 3 columns, Date Received, Facility, Status. It looks like this:

 

Date                                     Facility                                    Status                  Volume (# of Rows where Account # is not a duplicate)

1/1/16                                  Red                                         Complete

1/1/16                                  Red                                         Pending         

1/1/16                                  Blue                                        Pending

1/2/16                                  Red                                         Complete

1/2/16                                  Blue                                        Complete

1/2/16                                  Green                                      Complete

1/2/16                                  Green                                      Pending

7 REPLIES 7
richbenmintz
Solution Sage
Solution Sage

I would use the distinctcount function, measure would look like foo=distinctcount('table'[bar])



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


It's close, but it doesn't sort on the current table's rows. It gives the the total for the # of accounts:

 

Red = 18766

Blue =18766

Green = 18766

 

I need it to be

Red =8766

Blue = 4000

Green = 6000

 where the total of these would equal that distinctcount of 18766 and also sorted by the dates of the first column

in the distinctcount formula, are you referencing the account column of your data table? are you able to share your pbix file? not sure if you have related tables or really what your data looks like



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Unfortunately I can't share my data due to the nature of work.

 

The summary table I've created is 3 columns using the groupby function (Date, Facility, Status) that are from a "Detail Table."

This summary table is missing one column, the volume of accounts sorted by the 3 previously stated columns.

I am using the distinctcount('DetailTable'[Account Number]) which gives the correct total of distinct accounts but does not filter them.

 

I guess the best way to explain this would be if I used a pivot table of the "Detail Table" in excel and it had rows of:

Date [+]

Facility [+]

Status [+]

and the column would be the count of account numbers

Hi @jhinesly,

Based on your description, it is difficult for us to provide detailed method. Would you please share dummy data of your table and post expected result here?

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Test Data Detail.png

That is test data that I would like to summarize into knowing on "x" date - Facility A, B, etc.., had total number of volumes for Completed, Completed from Pending log, Pending, Backlog, etc..

 

Kind of like a pivot table would show:Test Data Summary.png

Hi @jhinesly,


Based on your pivot table, it seems that you filter the output. What fields do you use to filter the entire output?

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.