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
Luke_Howells
Helper I
Helper I

HELP: Complaints Count of 3 or More

Hi everyone,

I am having a little trouble with something I am trying to do in PowerBI desktop. 

I am looking at a set of data that revolves arounds a set of complaints. The structure of the data contains the site name, date, status. The staus is basically if the complaint is open or closed. What I am trying to do is work out how many sites have complained more than 3 times over a certain time period. I am using a slicer to change the dates so this I am ok with. It seems to be an easy one but just can't work it out!!!!! 😠

 

I should note that each site is in the set of data multiple times

 

example.png

1 ACCEPTED SOLUTION

Hi @Luke_Howells ,

 

Try this:

Count of Site whose complaints count of 3 or more = 
SUMX (
    FILTER (
        SUMMARIZE (
            'Table',
            'Table'[Site Name],
            "_CountofDate", CALCULATE (
                COUNT ( 'Table'[Date] ),
                FILTER ( 'Table', 'Table'[Status] <> BLANK () )    -------------------- edited
            ),
            "_DistinctCountofSite", DISTINCTCOUNT ( 'Table'[Site Name] )
        ),
        [_CountofDate] >= 3
    ),
    [_DistinctCountofSite]
)

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Icey
Community Support
Community Support

Hi @Luke_Howells ,

 

Create a measure like so:

Count of Site whose complaints count of 3 or more = 
SUMX (
    FILTER (
        SUMMARIZE (
            'Table',
            'Table'[Site Name],
            "_CountofDate", COUNT ( 'Table'[Date] ),
            "_DistinctCountofSite", DISTINCTCOUNT ( 'Table'[Site Name] )
        ),
        [_CountofDate] >= 3
    ),
    [_DistinctCountofSite]
)

complain.gif

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Icey Thanks for the help. I should also mention that column Status contains blank records. Would it be possible to ignore these records?

 

example.png

Hi @Luke_Howells ,

 

Try this:

Count of Site whose complaints count of 3 or more = 
SUMX (
    FILTER (
        SUMMARIZE (
            'Table',
            'Table'[Site Name],
            "_CountofDate", CALCULATE (
                COUNT ( 'Table'[Date] ),
                FILTER ( 'Table', 'Table'[Status] <> BLANK () )    -------------------- edited
            ),
            "_DistinctCountofSite", DISTINCTCOUNT ( 'Table'[Site Name] )
        ),
        [_CountofDate] >= 3
    ),
    [_DistinctCountofSite]
)

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Icey That's great thanks for your help 😄 

amitchandak
Super User
Super User

Use this with site name

sumx(filter(summarize((Table),Table[site],"_sum",count(table[Date])),[_sum]>3),[_sum])

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.