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 all,
I have a table:
Created date / Name / Closed date
1.1.2019 / project A / <none>
1.1.2019 / project B / 20.2.2019
2.1.2019 / project C / <none>
10.2.2019 / project D / 3.3.2019
I have a time slicer. When user select a date interval, user expect to see only ongoing projects.
E.g.
If user selects 1.1.2019 - 1.2.2019, the result should be:
1.1.2019 / project A / <none>
1.1.2019 / project B / 20.2.2019
2.1.2019 / project C / <none>
if user selects 1.2.2019 - 1.3.2019, the result should be:
1.1.2019 / project A / <none>
2.1.2019 / project C / <none>
10.2.2019 / project D / 3.3.2019
Any idea how i can do this? Thank you for help!
Solved! Go to Solution.
Hi @Anonymous,
all solutions I've seen were about creating a list of all dates between Created date and Closed date and using the slicer on the new field. But it works only if your range has both timestamp, a start and an end one.
let Source = FactTableOrig, #"Added ListOfDatesBetweenFromDateAndToDate" = Table.AddColumn(Source, "ListOfDatesBetweenFromDateAndToDate", each {Number.From([FromDate])..Number.From([ToDate])}), #"Expanded ListOfDatesBetweenFromDateAndToDate" = Table.ExpandListColumn(#"Added ListOfDatesBetweenFromDateAndToDate", "ListOfDatesBetweenFromDateAndToDate"), #"Changed Type To Date" = Table.TransformColumnTypes(#"Expanded ListOfDatesBetweenFromDateAndToDate",{{"ListOfDatesBetweenFromDateAndToDate", type date}}), #"Rename New Column To InRangeDate" = Table.RenameColumns(#"Changed Type To Date",{{"ListOfDatesBetweenFromDateAndToDate", "InRangeDate"}}) in #"Rename New Column To InRangeDate"
And then in Power BI Desktop apply the slicer on the new InRangeDate field:
Hi @Anonymous,
all solutions I've seen were about creating a list of all dates between Created date and Closed date and using the slicer on the new field. But it works only if your range has both timestamp, a start and an end one.
let Source = FactTableOrig, #"Added ListOfDatesBetweenFromDateAndToDate" = Table.AddColumn(Source, "ListOfDatesBetweenFromDateAndToDate", each {Number.From([FromDate])..Number.From([ToDate])}), #"Expanded ListOfDatesBetweenFromDateAndToDate" = Table.ExpandListColumn(#"Added ListOfDatesBetweenFromDateAndToDate", "ListOfDatesBetweenFromDateAndToDate"), #"Changed Type To Date" = Table.TransformColumnTypes(#"Expanded ListOfDatesBetweenFromDateAndToDate",{{"ListOfDatesBetweenFromDateAndToDate", type date}}), #"Rename New Column To InRangeDate" = Table.RenameColumns(#"Changed Type To Date",{{"ListOfDatesBetweenFromDateAndToDate", "InRangeDate"}}) in #"Rename New Column To InRangeDate"
And then in Power BI Desktop apply the slicer on the new InRangeDate field:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
44 |
User | Count |
---|---|
204 | |
105 | |
99 | |
64 | |
54 |