Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All,
Sadly here once again.
I have to create a measure which, given a date by the user, checks if it is between two dates, and counts how many times it happens.
Herewith my thought process:
X = Date given by the user
Measure = CALCULATE(COUNTROWS('Table'), X >= 'Table'[First Date] && X <= 'Table'[Second Date])
Now, my problem is when i have to do - X = Date given by the user - since i have no idea how it could be done. Is there any way i can give the measure a parameter which is given by the user?
So something like, i put something in the report where the user can type, make a measure which takes that value and in my measure above i replace X with this new measure.
Thanks,
L
Solved! Go to Solution.
Try:
Measure =
var DateSelected = SelectedValue(Table[Date])
return
CALCULATE(COUNTROWS('Table'), Filter(DateSelected >= 'Table'[First Date] && DateSelected <= 'Table'[Second Date]))
Hey @qLollo ,
You can provide a slicer with all the permissible dates you want user to select.
And when the user selects the date, you can capture that information using
DateSelected = Selectedvalue(Table[Date])
Further you can use it in your calculation.
Hi @PC2790, thanks for replying.
What you suggested to get the selected date works fine.
The problem now is that when i replace the X with the measure [DateSelected] i get an error.
Which is: In a True/False expression, used as a table filter, a function 'PLACEHOLDER' has been used, this is not allowed
The measure now is
Try:
Measure =
var DateSelected = SelectedValue(Table[Date])
return
CALCULATE(COUNTROWS('Table'), Filter(DateSelected >= 'Table'[First Date] && DateSelected <= 'Table'[Second Date]))
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 104 | |
| 81 | |
| 66 | |
| 50 | |
| 45 |