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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filter by active licenses based on the time slicer

Hi,

 

I have a table with a list of users, each with a start and end date for their subscription.

 

What I would like to add to reports is a way to filter the visuals just considering the users which had an active subscription depending on the calendar date slicer. 

 

So for example:

 

User A  has a start subscription date the 15/1/2022 and expiration subscription date the 15/5/2022. So if I choose March 2022 in my date slicer they should pop up, but if I choose June 2022 they shouldn't. 

 

How can I achieve it? Through a measure or column? and how can the DAX be?

10 REPLIES 10
Anonymous
Not applicable

@johnt75 It doesn't work, it returns 1 also when the license is expired. Any idea on why?

can you post a screenshot ?

Anonymous
Not applicable

Andmi00_0-1660208514265.png

 

Sorry, I meant a screenshot of the table visual showing the incorrect data

Anonymous
Not applicable

Andmi00_0-1660208985562.png

This User had a License start date in Sep 2021 and expired in Jan 2022, so before and after should be 0

Is it possible for an email address to appear multiple times in keystone_users? that would prevent SELECTEDVALUE from working

Anonymous
Not applicable

No, every user appears max one time.

Anonymous
Not applicable

No, every user appears max one time.

for debugging try changing the measure to return licenceStartDate and then licenceEndDate, see what that shows.

is there a relationship between calendar and keystone_users? if so, what is the cardinality and direction ?

johnt75
Super User
Super User

As it needs to react to slicers it will have to be a measure, not a column. You can create a measure like

User has active licence =
var minDate = MIN('Date'[Date])
var maxDate = MAX('Date'[Date])
var licenceStartDate = SELECTEDVALUE( 'Table'[Licence start date])
var licenceEndDate = SELECTEDVALUE('Table'[Licence end date])
return IF( licenceStartDate <= minDate && ( ISBLANK(licenceEndDate) || licenceEndDate >= maxDate ), 1 )

then put that as a filter on your table visual to only show when the value is 1

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.