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

Date picker

Hi,

 

My input dataset is as follows:

ara_4_0-1597282453343.png

 

The date picker will show all the dates. Based ont he dates I choose fromt he date picker, the table will have last 4 months from the selected date displayed int he table as shown below.

I would like my output to be as follows:

 

ara_4_1-1597282488272.png

 

Any ideas??

8 REPLIES 8
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

Did I answer your question ? Please mark my reply as solution. Thank you very much~

If not, please upload some insensitive data samples and expected output.

 

Best Regards,

Eyelyn Qin

v-eqin-msft
Community Support
Community Support

 Hi @Anonymous ,

According to my understanding, you want to  dynamically display the data for the last four months based on the slicer, right?

 

You could use the following formula:

//create a table for slicer

forSlicer =
ALLSELECTED ( 'Dynamic'[Date] )
last4 =
VAR selected =
    MAX ( forSlicer[Date] )
VAR minDate = selected - 4 * 30
RETURN
    IF (
        SELECTEDVALUE ( 'Dynamic'[Date] ) <= selected
            && SELECTEDVALUE ( 'Dynamic'[Date] ) >= minDate,
        1,
        0
    )

My visualization looks like this:

 dynamic slicer.PNG

Is the result what you want? If not, please upload some data samples and expected output.

Please do mask sensitive data before uploading.

 

Best Regards,

Eyelyn Qin

parry2k
Super User
Super User

@Anonymous I would recommend using relative date filter function, like show last 4 months etc.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 

 



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.

Anonymous
Not applicable

Hi @parry2k ,

 

I've now edited my post.. Sorry 

@Anonymous my reply is the same, use relative date filter, much easier to work with otherwise you have to create disconnected table for slicer and then work with measures, etc, can be achieved but seems overkill when relative date filter can achieve the same goal.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



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.

Anonymous
Not applicable

My output table is a MATRIX and I need to sort it by descending order, I'm not sure how I can do this by relative filtering

@Anonymous not sure what you mean? You will have a date in the matrix column and use a relative date filter and it will work. Have you even tested it? Why not you spend some time test it before you come back with further questions. 

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



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.

Anonymous
Not applicable

@parry2k 

 

After I use my slicer and use relative data for last 4 months, it will only show me last 4 months in the drop down. I want all dated to be displayed in the drop down, and based onw hat user selects the output matrix will display only last 4 months

ara_4_0-1597283977708.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!

November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

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.