Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Average on distinctCount

Dear everyone,

I need help to have the average of a distinctCount. I did some research , but without success. I hope that I will be clear:

I have the data below:

mystarc_0-1653950091180.png

 

I would like to know the distinct count color per country per product, so I created a new measure DistinctCount. So I created a matrix that display these info:

mystarc_1-1653950196624.png

 

But now, I need the average per country in a diagram or table like below in blue. I don't know how to do it. Can you please help me ? Thank you very very much !

mystarc_2-1653950285200.png

 

 

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Anonymous 

 

Try this measure:

Average Per Country = 
VAR _A =
    SUMMARIZE (
        'Table',
        'Table'[Country],
        'Table'[Product],
        "DisC", DISTINCTCOUNT ( 'Table'[Color] )
    )
RETURN
    AVERAGEX ( _A, [DisC] )

 

Output:

VahidDM_0-1653951651332.png

 

 

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 Do you like to see the FIFA Word Cup Dashboard:

https://community.powerbi.com/t5/Charticulator-Design-Challenge/FIFA-World-Cup-Medal-Records/cns-p/2545975

 

View solution in original post

2 REPLIES 2
VahidDM
Super User
Super User

Hi @Anonymous 

 

Try this measure:

Average Per Country = 
VAR _A =
    SUMMARIZE (
        'Table',
        'Table'[Country],
        'Table'[Product],
        "DisC", DISTINCTCOUNT ( 'Table'[Color] )
    )
RETURN
    AVERAGEX ( _A, [DisC] )

 

Output:

VahidDM_0-1653951651332.png

 

 

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 Do you like to see the FIFA Word Cup Dashboard:

https://community.powerbi.com/t5/Charticulator-Design-Challenge/FIFA-World-Cup-Medal-Records/cns-p/2545975

 

Anonymous
Not applicable

Thank you very very much @VahidDM !!! It works very well ! You saved my day 😁

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.