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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Average based on distinct count and summing up

Input TableInput TableOutputOutput

Hi everyone,
I have a input table with ID . i need a measure which calculates average of due days foe each Id. In this example my output should be 25. It should sum up the due dates for each ID and then calculate average.when i have a slicer for ID and if i take a single ID it must show sum of due dates(ID 110=15, ID 112=30)
I have tried the following measure
1)m1= averagex(summarize(fi,fi[ID],fi[Due Days]),fi[Due Days])
2)m2=calculate(average(fi[Due Days]),distinct(fi[ID]))

Also note that i am using this measure in a card visual and if i have a slicer for ID, IF i filter by ID=110 the output should be 15(10+5)

1 ACCEPTED SOLUTION
DimaMD
Solution Sage
Solution Sage

Hi @Anonymous what is your desired result?
Screenshot_15.jpg


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

View solution in original post

6 REPLIES 6
MattAllington
Community Champion
Community Champion

Create a dimension table containing all the unique IDs.
Join it to this table shown

remove the ID shown and replace with the ID from the dim table. 
then write a measure

AVERAGEX(NewDimTable,calculate(sum(originalTable[due days])))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

@MattAllington like i said i need this for a card visual so will this method work, is there a way we could achieve the same functionality with a measure?

 

DimaMD
Solution Sage
Solution Sage

Hi @Anonymous what is your desired result?
Screenshot_15.jpg


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com
Anonymous
Not applicable

25 is desired result, Lets say you add this measure to a card visual, you have a slicer for ID you select an ID 110 it should display 15(10+5).

@Anonymous  yes it work
Screenshot_16.jpg


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com
Anonymous
Not applicable

@DimaMD  Thank you , it works

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (29)