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.
I have a table with Month Counyr and HC. I have country and HC will repeat for all month.
But i need to calculate the Average HC based on the distint count of HC.
So based onm the below table in need to get the average of two month like 454.75 ( By taking the Distinct HC ). But when i use the avg function i am getting 446.30.
I need a formula that will give me 454.75.
Month | Country | HC |
Jan- 01-2020 | India | 234 |
Jan- 01-2020 | India | 234 |
Jan- 01-2020 | India | 234 |
Jan- 01-2020 | India | 234 |
Jan- 01-2020 | India | 234 |
Jan- 01-2020 | India | 234 |
Jan- 01-2020 | India | 234 |
Jan- 01-2020 | US | 343 |
Jan- 01-2020 | US | 343 |
Jan- 01-2020 | US | 343 |
Jan- 01-2020 | US | 343 |
Jan- 01-2020 | US | 343 |
Jan- 01-2020 | US | 343 |
Feb-01-2020 | India | 456 |
Feb-01-2020 | India | 456 |
Feb-01-2020 | India | 456 |
Feb-01-2020 | India | 456 |
Feb-01-2020 | India | 456 |
Feb-01-2020 | India | 456 |
Feb-01-2020 | India | 456 |
Feb-01-2020 | US | 786 |
Feb-01-2020 | US | 786 |
Feb-01-2020 | US | 786 |
Feb-01-2020 | US | 786 |
Feb-01-2020 | US | 786 |
Feb-01-2020 | US | 786 |
Solved! Go to Solution.
HI @unnijoy ,
You can try
Average Of Country =
AVERAGEX (
SUMMARIZE (
'Table',
'Table'[month],
'Table'[Country],
'Table'[HC],
"DC", SUM ( 'Table'[HC] )
),
'Table'[HC]
)
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Hi @unnijoy, Try this formula:
HI @unnijoy ,
You can try
Average Of Country =
AVERAGEX (
SUMMARIZE (
'Table',
'Table'[month],
'Table'[Country],
'Table'[HC],
"DC", SUM ( 'Table'[HC] )
),
'Table'[HC]
)
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
I tried the formula that you gave. But if HC is same for different month for same country it is taking the HC only once.
Eg: Jan 2020 India = 234
and in March 2020 India = 234. At that time the formula is taking 234 only once. Can you tell me wer i went wrong.
The issue is fixed.
I change the formula to
@unnijoy , try like
averageX(summarize(Table,Table[month],table[Country HC],"_1",[Distinct count measure]),[_1])
or
averageX(summarize(Table,table[Country HC],"_1",[Distinct count measure]),[_1])
Will check out your blog post!
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |