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.
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:
I want to get the counts of unique pairings between Column 1 and Column 2 (simliar to below):
Any help appreciated!
Solved! Go to Solution.
First, check if the default summarization of the column hour is “Don’t summarize”:
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:
If it helps, pls mark this post as a solution and give a kudo. Thanks
First, check if the default summarization of the column hour is “Don’t summarize”:
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:
If it helps, pls mark this post as a solution and give a kudo. Thanks
@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
When I plot:
Axis: HOUR
Values: Counts
Legend: Unique Combinations
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.
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
Proud to be a Super User!
@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]))
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |