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

Average of Distinccount

 

# DeviceUsed = Distinctcount Divice ID

week 2: 92 device is used,

Week 3: 94 device is used, 

But Week 2 and 3 : 97 device is used. 

 

So I am trying to do the avg device use between week 2 and 3, 

instead of doing 92+94 / 2 = 93 ; 

I got 97/2 = 48..

 

Can any one help me with this?

 Capture1.PNG

 

1 ACCEPTED SOLUTION

Please try this expression which, since you indicated you have a Calendar table, is a variation on the solution proposed by @amitchandak 

 

NewMeasure = AVERAGEX(VALUES('Calendar'[Week]), CALCULATE(DISTINCTCOUNT(Table_1[Device ID])))

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

It sounds like a common requirement to apply multiple aggregate functions into DAX expressions. I'd like to suggest you take a look at the following blog to apply multiple aggregations.

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

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

@Anonymous , Try like

averageX(Table[week],[Avg Measure])

Anonymous
Not applicable

@amitchandak That was a super quick response. However, that's not what i need. (or am i missing something?) 

 

My raw table_1 looks like 

Device ID | Event Date 

Device 1       | DD/MM/YY

......

Device 99     | DD/MM/YY  

 

And week of the year is on a calendar table. 

 

So when i do distcincount of Device ID, week 2 = 92, and week 4 = 94,  how do i get averge of 94? 

according to you. I will do averagex(table_1[Event Date], and ? ). can you explain further please? 

 

Thank you

Please try this expression which, since you indicated you have a Calendar table, is a variation on the solution proposed by @amitchandak 

 

NewMeasure = AVERAGEX(VALUES('Calendar'[Week]), CALCULATE(DISTINCTCOUNT(Table_1[Device ID])))

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.