The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have the following SQL which returns rows based on <= GETDATE() and >= GETDATE()
select b.umr
,b.inception_date
,b.expiration_date
from binder b
WHERE b.inception_date<=CAST(GETDATE() AS DATE) -- GETDATE() would instead be a single list date slicer
AND b.expiration_date>=CAST(GETDATE() AS DATE) -- GETDATE() would instead be a single list date slicer
How am I able to achieve this in Power BI? GETDATE() would basically be a single list date slicer
Solved! Go to Solution.
Hi @brian0782 ,
First create a calendar table as a slicer:
date_slicer = CALENDAR(MIN('Table'[inception_date]),MAX('Table'[expiration_date]))
and then create a measure to apply to the visual level filter
Measure = IF(SELECTEDVALUE(date_slicer[Date])>=MAX('Table'[inception_date])&&SELECTEDVALUE(date_slicer[Date])<=MAX('Table'[expiration_date]),1,0)
Enable the "Single select" option
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @brian0782 ,
First create a calendar table as a slicer:
date_slicer = CALENDAR(MIN('Table'[inception_date]),MAX('Table'[expiration_date]))
and then create a measure to apply to the visual level filter
Measure = IF(SELECTEDVALUE(date_slicer[Date])>=MAX('Table'[inception_date])&&SELECTEDVALUE(date_slicer[Date])<=MAX('Table'[expiration_date]),1,0)
Enable the "Single select" option
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Liang
This is almost working but was expecting a 1 in the higlighted row as it falls within the date range.
Not quite sure where I'm going wrong:
Hi @brian0782 ,
I guess this may be caused by aggregation or relationship. This row may correspond to more than one date. Try adding a umr column in the table visual and set slicer table as disconnected. If the problem persists, please delete the sensitive data and share a sample pbix.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, I think this is caused by a many to many bi-directional relationship between Binding Authority and Claim Amounts. We don't have any UMR records in Claim Amounts but we do in Binding Authority.
I thought a "Both" filter direction would help handle this.
I'm not able to attach a sample dashboard. I don't see an optuon to attach a file
Hi
Apologies for the late reply. This looks like it might work! I'll need to implement it but I can see this working..
Will give this a go and get back to you 🙂
Thanks
SELECTEDVALUE(Calendar[Date])