Forum Discussion
Count row with filter condition
- 4 years ago
hidzirf Please try this:-
Measure = CALCULATE(DISTINCTCOUNT('Table (2)'[Number]),FILTER('Table (2)',MONTH('Table (2)'[Date]) = MONTH( TODAY())-1))
Hi Samarth,
Thank you for your reply. I have tried the measure that you have shared but the result is not correct - showing as blank.
I'm giving you another example as below table.
Number | Question Type | Result | Date |
PART123 | Why | 3 | 28/2/2022 |
PART123 | How | 3 | 28/2/2022 |
PART123 | Where | 4 | 28/2/2022 |
PART123 | What | 4 | 28/2/2022 |
PART456 | Why | 2 | 15/2/2022 |
PART456 | How | 3 | 15/2/2022 |
PART456 | Where | 3 | 15/2/2022 |
PART456 | What | 4 | 15/2/2022 |
PART789 | Why | 5 | 10/1/2022 |
PART789 | How | 4 | 10/1/2022 |
PART789 | Where | 3 | 10/1/2022 |
PART789 | What | 2 | 10/1/2022 |
PART000 | Why | 5 | 1/1/2022 |
PART000 | How | 3 | 1/1/2022 |
PART000 | Where | 2 | 1/1/2022 |
PART000 | What | 2 | 1/1/2022 |
I would like to create a measure to show the number of participants on a card. So each participant needs to answer 4 types of questions. So I created a measure DISTINCTCOUNT(Table[Number]) to have the total numbers of participants which is 4. And now I have to create another measure to show how many participants for last month (February) which is should be 2.
Please let me know if you have any other suggestions.Thank you.
Regards,
hidzirf Please try this:-
Measure = CALCULATE(DISTINCTCOUNT('Table (2)'[Number]),FILTER('Table (2)',MONTH('Table (2)'[Date]) = MONTH( TODAY())-1))
- hidzirf4 years agoHelper I
Hi Samarth,
I appreciate your help so much. You have always provided me with a solution that has worked. Thanks a lot.