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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have 3 tables one is "summary" and other is "details" and another one is "date" table
open date, close date are two date columns from summary table and status column from details table and date column from date table
here i have logic and i would like to create date range in power bi based on opend date and close date conditions
Note that @end date used in multiple cases.
Status<>close
close date <= @EndDate
or
Status=close
open date >= @StartDate and open date <= @EndDate
in power BI i am trying to create two date slicers, one for start date and another for end date
in modeling open date and close date columns are mapped to date coulmn in date table, staus column from deatils table is mapped to status column in summary table
so finally in power BI i am using below approach to get date range.
1st date slicer for start date:
as per logic for start date slicer,i have considered date column from date table for open date and i set status=close in slicer visaul filter and applied date slection is "After" in slicer settngs
2nd date slicer for end date
as per logic for end date slicer, i have considered date column from date table for close date and created below calcualted column and set as 1 in slcier visual filter and finally set selection is "Before" in slicer settngs
End date filter = if( (MAX(open date)>=RELATED([Date])&& calculate(max(status),filter(status,(Status="Close"))
|| (MAX(close date)<=RELATED([Date]) && calculate(max(status),filter(status,(Status<>"Close")) ,1,0)
note that here @enddate is considered in multiple cases with OR condition.
as per above approach the date range is not working as expected so
please suggest with best approach to apply date range where the end date considered in multiple scenarios and also please suggest udpated dax code for possible solution Or please suggest can we get required date range by using only single date slicer by using measures...?
Thanks for your time, suggestions and help in advance.
Thanks,
Mahi1827..
Hi @Mahi1827 ,
You requirement can be achieved by measure. But without your sample data, I can't help you well. Would you please show us sample pbix by onedrive for business if possible?
Best Regard,
Dedmon Dai
Hi @Mahi1827 ,
Would you please inform us more detailed information( your
data and expected output (by OneDrive for Business)) if possible? Then we will help you more correctly.
Please do mask sensitive data before uploading.
Thanks for your understanding and support.
Best Regard,
Dedmon Dai
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 65 | |
| 43 | |
| 41 | |
| 32 | |
| 23 |
| User | Count |
|---|---|
| 200 | |
| 126 | |
| 103 | |
| 71 | |
| 54 |