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

From list to distinct list and then on the basis of distinct list find count.

Hi,

 

I'm trying to count of names greater than 1 from ditisnct list.

Thanks in advance.

 

Capture.JPG

 

1 ACCEPTED SOLUTION

HI @Anonymous,

 

If you want dynamic change 'distinct count' based slicer, you can try to use below formula.

Result = 
COUNTROWS (
    FILTER (
        SUMMARIZE ( ALLSELECTED(Table2), [Name], "Count", COUNT ( Table2[Name] ) ),
        [Count] > 1
    )
)

4.gif

 

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

11 REPLIES 11
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

I think you can write a measure with summarize and countrows functions to achieve your requirement.

 

Sample formula:

Result =
COUNTROWS (
    FILTER (
        SUMMARIZE ( 'Main List', [Name], "Count", COUNT ( 'Main List'[Name] ) ),
        [Count] > 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.
Anonymous
Not applicable

Hi @v-shex-msft @vanessafvg
Thanks for reply..


I'm getting result for only selected week only. But if I want a result from 0 - 41(selected filter).

*I'm  trying to find result for week 0-41. Suppose I select a week 41 in slicer , then I get main list (Image) and after that I trying to find distinct Count (Distinct list(image)) from week 0-41 and on top of that I trying to find count of names greater than 1.
All these in a measure1.

Hi @Anonymous,

 

Can you please share a pbix sample file with expected result? I will try it and share the formula if I can achieve these requirements.

 

Regards,

Xiaoxin Sheng

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

@v-shex-msft

Thanks for helping me.

 

I Do't know how to attach sample file, so sharing link. Hope this will help.

 

https://drive.google.com/file/d/1_Hx45yeCaCs4-8TEpREvyvQ_YabCbZnV/view?usp=sharing

HI @Anonymous,

 

If you want dynamic change 'distinct count' based slicer, you can try to use below formula.

Result = 
COUNTROWS (
    FILTER (
        SUMMARIZE ( ALLSELECTED(Table2), [Name], "Count", COUNT ( Table2[Name] ) ),
        [Count] > 1
    )
)

4.gif

 

Regards,

Xiaoxin Sheng

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

Hi @v-shex-msft

 

Thanks for helping me.

 

Actullly you selecting range, that's y you getting proper result but while drawing this to graph it will automatically select single week(as week is on X axis) and shows result for that particular week.

 

So when I draw graph, week 41 will show 33 unique customer greater than 1 . 

 

vanessafvg
Super User
Super User

@Anonymous you could do a group by in power query / m  with a count result and then creat a conditional column  where the count value is > 1?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

Thanks, really appreciate you for response. But I've some doubts.

 

There are week , date col. on left and many other col..

 

What I'm trying to do.

  

 Suppose I select a week 41 in slicer , then I get main list (Image) and after that I trying to find distinct Count (Distinct list(image)) from week 0-41 and on top of that I trying to find count of names greater than 1...all these in a measure1.

 

 

thanks in advance

@Anonymous

 

Try this MEASURE

 

Measure =
COUNTROWS (
    FILTER (
        ALLSELECTED ( Table1[Name] ),
        CALCULATE ( COUNT ( Table1[Name] ) > 1 )
    )
)

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Thanks Zubair,

 

I used the formula with little editing , but getting error. I trying to find result for week 0-41. Suppose I select a week 41 in slicer , then I get main list (Image) and after that I trying to find distinct Count (Distinct list(image)) from week 0-41 and on top of that I trying to find count of names greater than 1...all these in a measure1.

Measure =
COUNTROWS (
    FILTER (
        ALLSELECTED ( Table1[Name] ),
        CALCULATE ( COUNT ( Table1[Name] ) > 1,table[week]<=max(table[week) )
    )
)

 

 

Thanks for help.. 

Cheers! 

@Anonymous try this maybe?

 

Measure =
COUNTROWS (
    FILTER (
        ALLSELECTED ( Table1[Name] ),
        CALCULATE (
            COUNT ( Table1[Name] ) > 1,
            FILTER ( table, table[week] <= MAX ( table[week] ) )
        )
    )
)




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

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.