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

Unique Counts by Hour

Hi!

I'm trying to count the unique number of combinations between two columns by hour.

For example: I have data that looks like this:

 

 

4.PNG

 

 

I want to get the counts of unique pairings between Column 1 and Column 2 (simliar to below):

5.PNG

 

Any help appreciated!

1 ACCEPTED SOLUTION
mauriciosotero
Resolver III
Resolver III

First, check if the default summarization of the column hour is “Don’t summarize”:

 

Capture1.PNG

 

Then, create a new column for the Unique combination you want to count:

Unique Combination = CONCATENATE('Table'[Column1],'Table'[Column2])

 

So, create a measure Counts:

Counts = COUNT('Table'[Hour])

Finnaly, you can create you a table to visualize your result:

 

Capture2.PNG

 

If it helps, pls mark this post as a solution and give a kudo. Thanks

View solution in original post

6 REPLIES 6
mauriciosotero
Resolver III
Resolver III

First, check if the default summarization of the column hour is “Don’t summarize”:

 

Capture1.PNG

 

Then, create a new column for the Unique combination you want to count:

Unique Combination = CONCATENATE('Table'[Column1],'Table'[Column2])

 

So, create a measure Counts:

Counts = COUNT('Table'[Hour])

Finnaly, you can create you a table to visualize your result:

 

Capture2.PNG

 

If it helps, pls mark this post as a solution and give a kudo. Thanks

Anonymous
Not applicable

@mauriciosoterothis is very helpful!

There's one thing that I don't think is quite right.
I think the measure isn't working quite right?

For example, when I plot:
Axis: HOUR
Values: Counts

6.PNG

 

When I plot:
Axis: HOUR

Values: Counts

Legend: Unique Combinations

7.PNG

 

 

I think it is related to this: https://community.powerbi.com/t5/Desktop/Stacked-line-chart-doesn-t-stack/td-p/52108

My boss WANTS a stacked area chart, so it would be great if I could get it to stack 🙂

Hi,

 

I think the problem is because the zero counts are not calculated, so it is not plotted. I made a calculated table, so the zeros could appear. It is what do you need? A plotted an area chart, I think it is better.

 

You can donwload the file in this link: Pbix file 

 

If helps, I appreciate a kudo and mark as the solution.

 

 

Capture1.PNG

Nathaniel_C
Super User
Super User

Hi @Anonymous 

= CALCULATE (COUNT(table[Hour],ALLEXCEPT(table,table[Column 1],table[Column 2]))

Then you could use concatenate to create a new column that combined the values.

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





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

Proud to be a Super User!




Anonymous
Not applicable

@Nathaniel_CThanks for the response.

I received:

 

Too many arguments were passed into the COUNT function. The maximum argument count for the function is 1.

Hi @Anonymous ,

Sorry dropped a paren after hour
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

= CALCULATE (COUNT(table[Hour]),ALLEXCEPT(table,table[Column 1],table[Column 2]))




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

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.