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
parry2k
Super User
Super User

How to show data in dashboard for current month

Hello,

 

I created a dashboard to display sales by month. I have scheduled refresh for the data source but I want my dashboard to show sales by month for last 3 months. 

 

What I need to do in dashboard to automatically show data for current month + last 2 months instead of user has to filter and then pin on the dashboard.

 

I'm sure there is a way and need help.


Cheers,

P



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.

1 ACCEPTED SOLUTION
Rémi
Resolver III
Resolver III

Hi,

 

You have to create an intermediate measure :

Date difference = NOW() - MAX( [Date] )

Then you put a filter :

Date difference < 90

And you will have your data of the last three months.

View solution in original post

10 REPLIES 10
imanzi
New Member

The way I set it up required a few dimensions:

 

Today = TODAY()

StartOfMonth = TODAY() - DAY('MyTable'[Today]) + 1

CurrentMonth = IF('MyTable'[Date] >='MyTable'[StartOfMonth] && 'MyTable'[Date] <= 'MyTable'[Today],1,0)

 

Metric Current Month = IF(ISCROSSFILTERED('MyTable' [Month]),SUM('MyDataTable'[Metric]),CALCULATE(SUM('MyDataTable'[Metric]),FILTER('MyTable','MyTable'[CurrentMonth]= 1)))

 

And the Metric Current Month should be giving you this months results.

WillT
Community Admin
Community Admin

You could use Q&A to generate your visuals - that supports filters like 'for this month' or 'in the last 2 months'. They'll be dynamically updated as time goes by.

We do want to bring these capabilities to the Report view as well! Stay tuned!
Rémi
Resolver III
Resolver III

Hi,

 

You have to create an intermediate measure :

Date difference = NOW() - MAX( [Date] )

Then you put a filter :

Date difference < 90

And you will have your data of the last three months.

Hello,

 

The filter is available as a date format only. I am unable to select the date difference as < 90 days.

 

Can you help me?

 

Thank you

J

You got any answer to this? I have the same question.

It's possible to use DATEDIFF function:

 

Date difference = DATEDIFF(MAX(Mytable[Date]);TODAY();DAY)

@tgsteine

No, I am sorry.

Hello,

 

It is not clear to me how would I use the filter.

 

I was able to create the new measure.

djnww
Impactful Individual
Impactful Individual

Thanks for the great tip, @Rémi

 

I'm kicking myself for not thinking of this workaround solution.

 

- Daniel

Enrico
Frequent Visitor

We are here in the service forum, not dekstop.

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.

Top Solution Authors
Top Kudoed Authors