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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
ovetteabejuela
Impactful Individual
Impactful Individual

Using DAX, show data of previous 2 months, 5 weeks, 7 days

Hi again,

 

SO by using a DAX formula, how can I show data for

2 months: this month and the previous

5 weeks: this week and previous 4

7 days, today and previous 6

 

I want to end up with this:

 

MoMWoWDoD.PNG

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

So, in generaly, you are going to do this by wrapping an aggregation function with a CALCULATE with the appropriate filter. You may need to add some additional columns to your data that calculate some of this information using TODAY. For example, if you want the number of days from TODAY, you could do this:

 

DaysAgo = IF([Date]<TODAY(),DATEDIFF([Date],TODAY(),DAY),BLANK())

You could then do something like this:

 

Measure = CALCULATE(SUM(<column>),[DaysAgo]<6)


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler,

 

Thanks, I see what you're trying to suggest and I'm trying it out now.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.