Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
Anonymous
Not applicable

Show all values except values that are filtered out by time slicer

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!

1 ACCEPTED SOLUTION
Nolock
Resident Rockstar
Resident Rockstar

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"

Capture.PNG

 

And then in Power BI Desktop apply the slicer on the new InRangeDate field: 

Capture2.PNG

View solution in original post

1 REPLY 1
Nolock
Resident Rockstar
Resident Rockstar

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"

Capture.PNG

 

And then in Power BI Desktop apply the slicer on the new InRangeDate field: 

Capture2.PNG

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.