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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mkurup12
Helper I
Helper I

Distinct count of last selected value from filter

Hi!

I am using the following slicer to select two date ranges that will then filter the cards to show specific data about the two selected months. What is an easy way to do the calculations by the selected filters? (I thought I had figured it out by using the TOP N in the filter but the numbers are not accurate).

mkurup12_0-1646333317453.png

mkurup12_1-1646333350703.png

Thank you!

Monica

1 ACCEPTED SOLUTION
vojtechsima
Super User
Super User

Hi, @mkurup12 ,
depends if you use Date Table or if the Month Slicer represents a date, but generally, you can apply something like data between intervals like this:

BelongsToIntervalhMeasure = 
var _endOfInterval = MAX(DateTable[Date])
var _startOfInterval = MIN(DateTable[Date])

var _IntervalCheck = if(MAX([AdmitDate]) <= _endOfInterval && MAX(Admissions[DischargDateFixed]) >= _startOfInterval, "Something")
return _IntervalCheck

View solution in original post

2 REPLIES 2
vojtechsima
Super User
Super User

Hi, @mkurup12 ,
depends if you use Date Table or if the Month Slicer represents a date, but generally, you can apply something like data between intervals like this:

BelongsToIntervalhMeasure = 
var _endOfInterval = MAX(DateTable[Date])
var _startOfInterval = MIN(DateTable[Date])

var _IntervalCheck = if(MAX([AdmitDate]) <= _endOfInterval && MAX(Admissions[DischargDateFixed]) >= _startOfInterval, "Something")
return _IntervalCheck
PijushRoy
Super User
Super User

Hi @mkurup12 

You can use SELECTEDVALUE of month column in VARIABLE
and in RETURN section, you can use (like that)
_var = "Jan", "Your expected result",
_var = "Dec", "Your expected result",
"default result")

 

Please share sample data or pbix file, so I can provide proper dax


If you have any question, please keep posted
If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.