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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Memorable Member
Memorable Member

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
Memorable Member
Memorable Member

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

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.