Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Haripoola
Frequent Visitor

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

 

Haripoola_0-1646678293308.jpeg

 

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

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? 

vangzhengmsft_1-1647241398003.png

 

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.

Whitewater100
Solution Sage
Solution Sage

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. 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.