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

Show amount of counts per ID

Hi guys,

 

I have the following columns:

 

requests.PNG

I have a request ID where I cluster more requests under. I want to be able to show how many times per request ID a cluster request is added. 

 

For example: I want to see if my clustering is working properly. So if I see there has been no clustering it shows up as 100x 1 Cluster request. But if my clustering works properly it shows more then 1x per ID request.

 

A median of the amount of clusters works for me too. I just can't see to figure out how to set it up.

1 ACCEPTED SOLUTION

HI @Anonymous ,

You can try to use following measure formula to get distinct count of 'ID Request' who has more than one correspond 'cluster request':

Measure =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            ALLSELECTED ( Table ),
            [ID Request],
            "DC", DISTINCTCOUNT ( Table[Cluster Request] )
        ),
        [DC] > 1
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

10 REPLIES 10
cnweke
Resolver II
Resolver II

Make a barchart with ID request as axis and count cluster request as value.

 

What it'll do is the following:

 

List out all the ID requests on the x-axis. Count how many cluster requests there are per ID request.

 

OR do it in a measure:

 

ClusteringCount: calculate(distinctcount(ID request),count(cluster request) > 1)

 

This tells you how many.

 

Marked as solved if this helped you 🙂

Anonymous
Not applicable

Thanks for the quick reply @cnweke 

 

Maybe I explained it unclear, sorry about that.

 

When I do it your way I see every single request ID with their times clustered request.

 

But I want to know how many times a cluster has happend. Not per request.

 

Barchart requests.PNG

So for example I want to see Clustering 6 has happend 2x and clustering 4 has happend 3x 

On the top of my head:

 

ClusteringCount: calculate(distinctcount(ID request),count(cluster request) > 1) and changing >1 into =2, =3 ... would work. This is messy though you'd need 4-5 measures in total. 

 

If I come up with a single measure that is fit for purpose I'll reply again. You can get started with this though.

Anonymous
Not applicable

@cnweke 

 

When trying to use the measure I get the following error:

 

ClusteringCount  = calculate(DISTINCTCOUNT(offers[ID Request]), count(offers[Cluster Request] > 1))

The COUNT function only accepts a column reference as an argument.

ClusteringCount  = calculate(DISTINCTCOUNT(offers[ID Request]), count(offers[Cluster Request]) > 1)

 Your argument had to be fully in brackets

Anonymous
Not applicable

Sorry about that, wasn't paying attention.

 

I was getting the following error:

 

ClusteringCount = calculate(DISTINCTCOUNT(offers[ID Request]), count(offers[Cluster Request]) > 1)

A function 'COUNT' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

(count(offers[Cluster Request]) > 1)

 

Don't worry, it's partially my fault.

Intellisense made me incapable of writing anything better than pseudocode 🙂 

Anonymous
Not applicable

ClusteringCount = calculate(DISTINCTCOUNT(offers[ID Request]), (count(offers[Cluster Request]) > 1 )) 

Unfortunatly this still provides the same error 😞

HI @Anonymous ,

You can try to use following measure formula to get distinct count of 'ID Request' who has more than one correspond 'cluster request':

Measure =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            ALLSELECTED ( Table ),
            [ID Request],
            "DC", DISTINCTCOUNT ( Table[Cluster Request] )
        ),
        [DC] > 1
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

ClusteringCount = calculate(DISTINCTCOUNT(offers[ID Request]), (count(offers[Cluster Request]) > 1) = TRUE)

 

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.