Forum Discussion

Haripoola's avatar
Haripoola
Frequent Visitor
4 years ago

Countrows as per slicer selection

Hi folks,

I have a fact table which contains Student's details like below (attached sample copy), 
I'm trying to create a DAX expression that will enable me to return data when a student failed/passed status is in between a selected date range.
For example consider HARRY Data from below table When i select a date range of 01/01/19 to 31/05/21 using a date slicer, He should be treated as failed student and his count should be in Failed count, If i move slicer to 06/01/21 His count should be removed from Failed count and should be added in Passed student as he passed the exam on 06/01/21.
Please let me know if needed more information.

 

Any one please help how to solve it..

 

Thanks in advance

 

 

2 Replies

  • HI:

    You can try (if you have marked and continuous date table linked to your data table):

     = LASTNONBLANK(Table[exam status], CALCULATE(SUM(Table[StudentID])))

     

    Usually I have sales info or some other number column and the final part would be CALCULATE(SUM(Product[sales]) - so I'm hoping this works even though it sounds a little weird. 

  • Hi, Haripoola 

    How to calculate the count result when a state has multiple duplicate values.
    Could you please consider sharing more details about it and posting expected result so it is clear on what needs to be implemented? 

     

    Best Regards,
    Community Support Team _ Zeon Zheng


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.