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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
gill_thornton
Helper I
Helper I

Meassure with Filter

Hi

I work in a high school & am trying to create a measure that counts the number of students in a table with 2+ or 3+ exclusions.  I have a calendar table, which contains terms & dates.  I need to be able to add a slicer on my current visual which includes number of exclusions & number of students with exclusions.  My table is a list of student identifier, type of exlcusion (permanent or suspension) start date and end date number of days excluded.  I have tried using the following but it is just returning blanks:

No Students 2+ = CALCULATE(DISTINCTCOUNT(Exclusions[UPN]),
FILTER(
ALL(Exclusions),
Exclusions[Start date]>=MIN('Calendar'[Date])&&
Exclusions[Start date]<=MAX('Calendar'[Date])),
FILTER(ALLSELECTED(Exclusions),
CALCULATE(COUNTROWS(Exclusions))>=2))
 
Any help would be appreciated.

 

1 ACCEPTED SOLUTION

You can do that in a graphical way (putting the UPN and any column count in a table or matrix)

lbendlin_0-1687194063045.png

 

or you can have a card visual with a measure behind it

 

lbendlin_1-1687194197244.png

Both solutions will be impacted by any date range filters you may want to apply.

 

View solution in original post

4 REPLIES 4
gill_thornton
Helper I
Helper I

Sample Data 

 

I would expect to see 4 students with 2+ suspensions in this sample file.

 

Thank you for your help with this.

You can do that in a graphical way (putting the UPN and any column count in a table or matrix)

lbendlin_0-1687194063045.png

 

or you can have a card visual with a measure behind it

 

lbendlin_1-1687194197244.png

Both solutions will be impacted by any date range filters you may want to apply.

 

Thank you.  This worked perfectly.

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.