March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hi,
As reletavily new to Power BI I come up with the next problem (I'll try to expain it simple) :
I have a table "X" with four columns: PatientKey, Categorie, DateFrom and DateTo.
It contains data about the Categorie of the patient. For example Categorie "R" = Regular, "M"= Moved away.
So a patient can have multiple entries.
Now what I want in my dashboard is to type in a reference date and based on that date select the records where the DateFrom >= ReferenceDate and the ReferenceDate<=DateTo.
Anyone an idea?
Thx,
Rki
Solved! Go to Solution.
Hi @RKi ,
First you need to introduce a custom visual for the Text search slicer:
Then we need create a new date table for the silcer. Since the Text search slicer accepts values of text type, here I have added a new calculated column:
Here you can also format the date to the customer's preferred format, I demonstrated here is "YYYYMMDD".
Then create a new measure for the visual‘s filter:
Measure =
VAR __input = SELECTEDVALUE('Date'[Date])
VAR __cur_date_from = SELECTEDVALUE('Table'[DateFrom])
VAR __cur_date_to = SELECTEDVALUE('Table'[DateTo])
VAR __result = IF( ISBLANK(__input) || (__cur_date_from <= __input && __cur_date_to >= __input), 1)
RETURN
__result
result:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi @RKi ,
First you need to introduce a custom visual for the Text search slicer:
Then we need create a new date table for the silcer. Since the Text search slicer accepts values of text type, here I have added a new calculated column:
Here you can also format the date to the customer's preferred format, I demonstrated here is "YYYYMMDD".
Then create a new measure for the visual‘s filter:
Measure =
VAR __input = SELECTEDVALUE('Date'[Date])
VAR __cur_date_from = SELECTEDVALUE('Table'[DateFrom])
VAR __cur_date_to = SELECTEDVALUE('Table'[DateTo])
VAR __result = IF( ISBLANK(__input) || (__cur_date_from <= __input && __cur_date_to >= __input), 1)
RETURN
__result
result:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Thx for your solution. It works fine!!!
Great job
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
16 | |
13 | |
13 | |
9 |
User | Count |
---|---|
36 | |
31 | |
20 | |
19 | |
17 |