Forum Discussion
amaniramahi
4 years agoHelper V
Summarize and filter
I have a table contains the following columns in addition to many
The ActivityDate is used in a slicer
I need to calculate the disticntcount of Account names that have more than 1 activity subject to the selected period in ActivityDate slicer
| Account Name | ActivityDate |
| Account A | 1/1/2020 |
| Account A | 1/7/2020 |
| Account A | 1/8/2020 |
| Account A | 1/1/2021 |
| Account B | 1/1/2019 |
| Account B | 1/1/2020 |
| Account B | 1/7/2020 |
| Account C | 1/1/2018 |
| Account C | 1/1/2020 |
| Account C | 1/7/2020 |
| Account C | 1/9/2020 |
| Account C | 1/10/2020 |
| Account D | 1/1/2020 |
Mainly I tried the following
SUMMARIZE(
Activities,
Activities[Account Name],
"ActivitiesCount",COUNTA(KinzActivities[Account Name]
)but I didn't know how to filter the resulted table according to the calculated column "ActivitiesCount"
4 Replies
- CNENFRNLCommunity Champion
- amaniramahiHelper V
CNENFRNL , no wonder you are a community champion!
Thanks
- speedrampsSuper UserTry this and click leave kudos and accept the solutionYourmeasurename =
CALCULATE(DISTINCTCOUNT(Activities[Account Name]),REMOVEFILTERS(Activities[Account Name]))How it works:-When you create report by Activities[Account Date] and Activities[Account Name]then Power BI applies default filters to each row.The CALCULATE and REMOVEFILTERS commands remove the default Activities[Account Name] filter,but retain the default Activities[Account Date] filter.Thus returning an answer of 4 activies for 01/01/2000 and 3 for 01/07/2020- amaniramahiHelper V
Actually I dont see how it will work!
I need to calculate the accounts that have more than 1 activity within the a selectedperiod
If I selected 2020 year, it should return 3 not 4