Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
I have 2 field parameters: start_date and end_date:
Start_date = {("DE date", NAMEOF('Table'[DE_Date]), 0), ("OE date", NAMEOF('Table'[OE_Date]), 1)}
End_date = {("PV date", NAMEOF('Table'[PV_Date]), 0), ("Sold_Date", NAMEOF('Tables'[Sold_Date]), 1)}
I want to create a visual showing the datediff between the start and end date depending on the date chosen for each parameter.
Can someone help me with that?
Thank you
@nelmade , You need to try measures like
Selected Parameter = maxx(filter(Parameter ,Parameter[Parameter Order] = SELECTEDVALUE(Parameter[Parameter Order])), Parameter[Parameter])
Datediff =
SWITCH([Selected Parameter]
, "Start Date" ,datediff(Max(Table[Start date]), Today(), Day),
datediff(Max(Table[End Date]), Today(), Day),)
refer if needed
https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f
the datediff should include start date and end date : datediff(start_date, end_date, day)
my data looks like this table below:
OE date | DE date | PV date | Sold date |
3/15/2023 | 3/15/2023 | 3/15/2023 | 3/15/2023 |
1/25/2023 | 1/25/2023 | 3/9/2023 | 3/14/2023 |
3/16/2023 | 3/16/2023 | 3/16/2023 | 3/16/2023 |
3/16/2023 | 3/16/2023 | 3/16/2023 | 3/16/2023 |
10/3/2022 | 10/3/2022 | 3/17/2023 | 3/18/2023 |
2/28/2023 | 2/28/2023 | 2/28/2023 | 3/1/2023 |
3/10/2023 | 3/10/2023 | 3/10/2023 | 3/14/2023 |
and i created two fields parameters because i wanted the user to be able to swith between each type of start date and end to calculate the date difference