Forum Discussion
Filter and sum
- 9 years ago
In this scenario, what you want to return is just a DISTINCTCOUNT() of members within the YEARMONTH range your selected. You can just create a measure like below:
Distinct Members = CALCULATE ( DISTINCTCOUNT ( Table[ID] ), ALLSELECTED ( Table[YEARMONTH] ) )
Regards,
- 8 years ago
In your query, right-click your YEARMONTH column and duplicate it. Then, use YEARMONTH as your list slicer and YEARMONTH - Copy as your date range slicer. Then you can create a measure like this:
Measure 5 = CALCULATE(DISTINCTCOUNT('Members'[YEARMONTH]),ALLEXCEPT('Members','Members'[YEARMONTH - Copy]))
Seems like you could just do a SUM of MemberMonthCount but not enough information to really say.
- bsushy9 years agoFrequent Visitor
Could you help me with the calculated column "MemberMonthCount".
How do I write it....It should also be calculated only for those ID's which are in that selected memeber month '201704'
..Then it would be easy for me to write a measure for the sum.
- bsushy8 years agoFrequent Visitor
Greg_DecklerCould you help me with the calculated column "MemberMonthCount".
How do I write it....It should also be calculated only for those ID's which are in that selected memeber month '201704'
..Then it would be easy for me to write a measure for the sum.
- Greg_Deckler8 years agoCommunity Champion
Is your raw data just like in the image where you have ID and YEARMONTH columns in your data table? Please confirm and if not, please post some sample raw data.
Please read: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- bsushy8 years agoFrequent Visitor
Greg_Deckler: Yes.My data has ID and Yearmonth....I need to calculate MemberMonthCount...Thank you for the promt reply.