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
dsabsi
Advocate I
Advocate I

How do you show your data except for the last 6 weeks?

Hello everyone, 

 

I need your help with my Power BI dashboard. 

I have plotted a bunch of data regarding the revenues per customer and I have added year + week filters (DIM_DATE). 

 

I want to add a visual level filter in which I show all the data except for the last 6 weeks. 

Can anyone please help me with this? 

 

Thank you very much!!! Of course all of you will get thumbs up 😉

Here a printscreen of my DIM_DATE:

 

DIM_DATE.JPG

 

 

Cheers, 

 

DSabsi

1 ACCEPTED SOLUTION

Hi @dsabsi,

 

How about this? All the [FilterColumn] = 1 is the data you want.

 

FilterColumn =
IF ( [Date] <= TODAY () - 42, 1, 0 )

How do you show your data except for the last 6 weeks.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
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

4 REPLIES 4
Greg_Deckler
Super User
Super User

You probably want to add a calculated column that calculates the week differential from the current week. You can use WEEKNUM and TODAY functions for this in DAX. Then you could add this column to your visual filter area and restrict it to the values you want, >5 or >6 differential.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler, thanks for your swift reply. 

I tried to use your calculated solution but it didn't work for me...it shows as date 10-9-2017 which is 6 weeks ago. 

the formula: smoupre = today()-(weeknum(today();1)-6) 

 

but I want to have all the data except for 6 weeks ago... could you please be so kind to write this formula? 

 

Cheers, 

 

DSabsi

 

 

Hi @dsabsi,

 

How about this? All the [FilterColumn] = 1 is the data you want.

 

FilterColumn =
IF ( [Date] <= TODAY () - 42, 1, 0 )

How do you show your data except for the last 6 weeks.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

Assuming you have a Date column:

 

WeekNum Diff = WEEKNUM(TODAY()) - WEEKNUM([Date].[Date])

You could then filter this to be greater than 5 or 6. Might have some Year issues to worry about (a week in 2016 is the same weeknum as a week in 2017) but this is the general idea.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.