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
New2PowerBI
Helper III
Helper III

Date Slicers

I have many Table and columns, many of them with multiple sets of information and connected to different visualizations.

 

I have one visualization in particular where a customer wants to know everything that their direct reports have coming due from "TODAY" thru next year (365 days); how can I best achieve it?

 

For testing, I was able to add a Filter and enter the date range, but that seems to be something I'd have to redo everytime.  I know there has got to be a better way so that whenever the data is accessed it knows it's looking for data that is due that day thru 365 days. 

 

I read through some of the other Slicer posts but didn't quite find what I was looking for.  Any help will be greatly appreciated.

 

Thanks!

9 REPLIES 9
parry2k
Super User
Super User

Can you share your data mode for better answer but here is something I think will work:

 

You need add two columns

  

Current Date = TODAY()

 

Due in next 365 days = if(myTable[DueDate] >= TODAY() && myTable[DueDate] <= DATEADD(CurrentDate, 365, DAY), 1, 0)

And then drop this new column on filter and select where value is 1



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I think we are close.  🙂

 

All values resulted in "0" but I should have both 0 and 1 based on data.  Here is what I entered into 2nd column:

 

Due in next 365 days = if(PM[NEXTDATE] >= TODAY() && PM[NEXTDATE] <= DATEADD(PM[Current Date], 365, DAY), 1, 0)

 

Do you think I need to adjust the format on my [NEXTDATE] column?  The current values' format is (example):

 

4/1/2017 12:00:00 AM

 

 

Hello @New2PowerBI

 

Can you share sample data model since I don't know all the details and I proposed the situation based on some assumptions, if you can share the columns you have, it will be helpful 🙂

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Absolutely; what portion do you want to see?  The columns, table or how the line chart is set up?

columns with sample data 🙂



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

CSTM_IMPLEMENTERNEXTDATEPMNUMCurrent DateDue in next 365 days
JAYJ4/1/2017 12:00:00 AM STX683263/17/2017 12:00:00 AM0
JOHND4/2/2017 12:00:00 AMSTX683273/18/2017 12:00:00 AM0
GEORGR4/3/2017 12:00:00 AMSTX683283/19/2017 12:00:00 AM0
JAYJ4/4/2017 12:00:00 AMSTX683293/20/2017 12:00:00 AM0
JOHND4/5/2017 12:00:00 AMSTX683303/21/2017 12:00:00 AM0
GEORGR4/6/2017 12:00:00 AMSTX683313/22/2017 12:00:00 AM0
JAYJ4/7/2017 12:00:00 AMSTX683323/23/2017 12:00:00 AM0
JOHND4/8/2017 12:00:00 AMSTX683333/24/2017 12:00:00 AM0
GEORGR4/9/2017 12:00:00 AMSTX683343/25/2017 12:00:00 AM0

 

The last two columns is what I added; but in looking at all the values, everything is 0 although I think I should have 1's.

Hi @New2PowerBI,

 

You said that you added the last two column. How could the Current Date value is different in each row? Which fomular did you used to create this column?

CSTM_IMPLEMENTER NEXTDATE PMNUM Current Date Due in next 365 days
JAYJ 4/1/2017 12:00:00 AM  STX68326 3/17/2017 12:00:00 AM 0
JOHND 4/2/2017 12:00:00 AM STX68327 3/18/2017 12:00:00 AM 0
GEORGR 4/3/2017 12:00:00 AM STX68328 3/19/2017 12:00:00 AM 0
JAYJ 4/4/2017 12:00:00 AM STX68329 3/20/2017 12:00:00 AM 0
JOHND 4/5/2017 12:00:00 AM STX68330 3/21/2017 12:00:00 AM 0
GEORGR 4/6/2017 12:00:00 AM STX68331 3/22/2017 12:00:00 AM 0
JAYJ 4/7/2017 12:00:00 AM STX68332 3/23/2017 12:00:00 AM 0
JOHND 4/8/2017 12:00:00 AM STX68333 3/24/2017 12:00:00 AM 0
GEORGR 4/9/2017 12:00:00 AM STX68334 3/25/2017 12:00:00 AM 0

 

Regards,

Charlie Liao

That is weird; it must have copied over that way from Excel.  What I used in the New Column was:

 

Current Date = TODAY()

 

When I looked earlier it displayed as 3/30/2017 12:00:00 AM for all values. 

Forgot to include the other column, it contains the following:

 

Due in next 365 days = if(PM[NEXTDATE] >= TODAY() && PM[NEXTDATE] <= DATEADD(PM[Current Date], 365, DAY), 1, 0)

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.