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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
brunozanoelo
Helper V
Helper V

Filter to select last month and the weeks of the last month

Hi Guys, fine?

I have one problem here, i need to show one filter to the user select the last's weeks by now.

Like this:

Period
Last month
Last month(Week 1)
Last month(Week 2)
Last month(Week 3)
Last month(Week 4)
Last month(Week 5) <= if have


How can i do that?

1 ACCEPTED SOLUTION

Ok, if the the preview date slicer is not acording your need, sure we can do it. First you should go to edit query and select the date column. Then add column of the week of month. Apply changes. Now with the tabular model created, add a column with dax like this:

= IF ( AND (

                    YEAR(Table[Date]) = YEAR(NOW()) ,

                    MONTH(Table[Date]) = MONTH(NOW())

                  ) ,

           "Last Month",

           "Other Months"

        )

With this you can have a filter to run last month, and a filter with weeks in order to check the specific week of the last month.

 

Regards,

                  


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

Happy to help!

LaDataWeb Blog

View solution in original post

3 REPLIES 3
ibarrau
Super User
Super User

Hi, this is becoming really popular problem haha. Okay, first i don't think you will be able to have all this information in one column categorized in one filter. You can have a filter for last month and another to select the week of the last month. (if you are good with this idea, I can help you creating a dax columns to success this)

 

Another approach is to activate the preview feature in desktop (under options menu) corresponding to relative date slicer. Here is more info: https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-may-feature-summary/#relativeDateSlicer

 

Regards, hope this helps


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

Happy to help!

LaDataWeb Blog

Hi @ibarrau! Thanks for the reply!!

i already used the date slicer and in not quite sure about use it. Can u help me create those dax columns?

Thanks a lot!!

Regards! ^^

Ok, if the the preview date slicer is not acording your need, sure we can do it. First you should go to edit query and select the date column. Then add column of the week of month. Apply changes. Now with the tabular model created, add a column with dax like this:

= IF ( AND (

                    YEAR(Table[Date]) = YEAR(NOW()) ,

                    MONTH(Table[Date]) = MONTH(NOW())

                  ) ,

           "Last Month",

           "Other Months"

        )

With this you can have a filter to run last month, and a filter with weeks in order to check the specific week of the last month.

 

Regards,

                  


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

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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