Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello,
I have a table with DirectQuery connection to Databricks. My table only have one date column - dueDate. My end user will pick their date through date slicer that has between option.
I've checked using DAX studio what query the slicer send to data source once it is filtered and it shows as MIN (dueDate) and MAX(dueDate):
I am trying to setup a multi-value dynamic parameter from date slicer. So when user choose the date, Power BI will send a custom query back to datasource with dynamic date as it parameter.
I was able to pass a date to dynamic parameter if its in single value, but I am currently struggling with multi-value.
I found this article https://blog.crossjoin.co.uk/2020/11/08/handling-multi-select-in-power-bi-dynamic-m-parameters/ and tried to do like the example provided but was clueless on how the parameter decide which is the MIN and MAX.
currently this is what I wrote in my sql query:
let
TextDate = DateTime.ToText(dateParam, "yyyy-MM-dd 00:00:00"),
Source = select * from mytable where dueDate BETWEEN CAST('"& TextDate &"' AS Date) AND CAST('"& TextDate &"' AS Date)
in
Source
//for reference of how i imagine:
//select * from myTable where dueDate BETWEEN CAST('2023-10-02' AS Date) AND CAST('2023-10-14' AS Date)
at first, i wrote a code for checking if its a List.Type before TextDate but I am stuck there.
let
DateParamList =
if
//check if its a list
Type.Is(
Value.Type(dateParam),
List.Type
) then
//if its a list
let
//i stuck here because i dont know how to make it as min max from the list.
Hope my explanation is clear enough. Please help me with this, I have been stuck for one week 😭
Please see the below tutorial, i guess this is what you are looking for.
Setup Dynamic Parameters to Filter data in your PowerBI Report | MiTutorials - YouTube
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
87 | |
79 | |
62 | |
61 | |
59 |
User | Count |
---|---|
166 | |
114 | |
99 | |
73 | |
65 |