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
annam
Frequent Visitor

Date with few empty dates - hwo to create Between slicer

I have payment date column and trying to create slicer with between. Bu when I select date from slicer it empties table. any work around?

1 ACCEPTED SOLUTION
v-xianjtan-msft
Community Support
Community Support

Hi @annam 

 

My solution is to add missing dates in the source data and fill in the amount as “BLANK”.

In this way, when using a slicer with between, there will be no interval dates that cause visual objects to be empty.

 

  1. Here are the columns included in my example table.  1.png
  2. Create a new table using the following DAX :

    CompleteTable = ADDCOLUMNS(

        CROSSJOIN(

            CALENDAR(MIN(Payment[Date]), MAX(Payment[Date])),

            DISTINCT(Payment[Name])),

            "Amount",

            COALESCE(LOOKUPVALUE(Payment[Amount],Payment[Date],[Date]), BLANK())

    2.png

  3.  Create a one-to-many relationship from table“Payment” to table“CompleteTable” by “Date” columns.  3.png

  4. Put “Date”, “Amount” from table“CompleteTable” and “Name” from table“Payment” into the visual object. Put “Date” from table“CompleteTable” into the slicer.  4.png4-1.png

  5. Here is my final test result.  5.png5-1.png

I hope this solution meets your requirements.

 

 

Best Regards,

Jarvis Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xianjtan-msft
Community Support
Community Support

Hi @annam 

 

My solution is to add missing dates in the source data and fill in the amount as “BLANK”.

In this way, when using a slicer with between, there will be no interval dates that cause visual objects to be empty.

 

  1. Here are the columns included in my example table.  1.png
  2. Create a new table using the following DAX :

    CompleteTable = ADDCOLUMNS(

        CROSSJOIN(

            CALENDAR(MIN(Payment[Date]), MAX(Payment[Date])),

            DISTINCT(Payment[Name])),

            "Amount",

            COALESCE(LOOKUPVALUE(Payment[Amount],Payment[Date],[Date]), BLANK())

    2.png

  3.  Create a one-to-many relationship from table“Payment” to table“CompleteTable” by “Date” columns.  3.png

  4. Put “Date”, “Amount” from table“CompleteTable” and “Name” from table“Payment” into the visual object. Put “Date” from table“CompleteTable” into the slicer.  4.png4-1.png

  5. Here is my final test result.  5.png5-1.png

I hope this solution meets your requirements.

 

 

Best Regards,

Jarvis Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Joe_Barry
Super User
Super User

Hi @annam 

Why not use a Date Table?

Create an Active One to Many relationship from the Date column in the Date table to the payment date column in your table.

Create a slicer from the Date column in the date table and use the columns from the Data table in a visual that has a measure from your table.

 

Hope this helps

Joe




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


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.