Forum Discussion
abukapsoun
3 years agoPost Patron
Sum & average
Hi Guys, Need your support please, I have the following dataset for each of the day: I want to Sum people based on city, then i want to average the city based on flag. so Ger = average...
- 3 years ago
Download the PBI file.
Anonymous
3 years agoNot applicable
Hi abukapsoun ,
Please try below steps:
1. below is my test table
Table:
Table2:
create with below dax formula:
Table 2 = VALUES('Table'[City])
2. create a measure with below dax formula
Measure =
VAR cur_city =
SELECTEDVALUE ( 'Table 2'[City] )
VAR tmp1 =
FILTER ( ALL ( 'Table' ), [City] = cur_city )
VAR tmp2 =
SUMMARIZE (
tmp1,
'Table'[Date],
'Table'[City],
'Table'[Flag],
"Sum", SUM ( 'Table'[People] )
)
RETURN
AVERAGEX ( tmp2, [Sum] )
3. add a slicer with Table2, add a card visual with above measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ā
abukapsoun
3 years agoPost Patron
Didn't really work with me š
Can you please check the following post, I have included the dataset I am working on. I would really appreciate if you can have a look please.
https://community.powerbi.com/t5/Desktop/Matrix-with-different-level/m-p/2902152#M997246
Thanks,