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
Anonymous
Not applicable

Bar Chart show data from current date each month

Hello everyone,

I need guidance for what I currently thinking, is it possible to create a Bar Chart that will show data from certain dates or filtered dates in each month? Well, let's say I want to see how much data that will show up on the 1st date of each month. Like the data on 1st Jan, 1st Feb, 1st March. And from there I want to do a comparison from each date on each month.

jonathangabe_0-1634538116528.png

This is my current bar chart that I already create on the PowerBI, but I'm trying to accomplish the idea that has already been described before. Thank you.

 

1 ACCEPTED SOLUTION
TheoC
Super User
Super User

Hi @Anonymous 

 

If I am understanding your requirement, you should be able to take the "Day" from the Date Hierarchy and add that as a Slicer so that you can select the Day of each Month and compare only the Day that you want (i.e. first, second, third, fourth, etc., etc)...

 

TheoC_0-1634538850767.png

TheoC_1-1634538879080.png

 

Hope this helps 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

9 REPLIES 9
TheoC
Super User
Super User

Hi @Anonymous 

 

If I am understanding your requirement, you should be able to take the "Day" from the Date Hierarchy and add that as a Slicer so that you can select the Day of each Month and compare only the Day that you want (i.e. first, second, third, fourth, etc., etc)...

 

TheoC_0-1634538850767.png

TheoC_1-1634538879080.png

 

Hope this helps 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Anonymous
Not applicable

Hi @TheoC, thank you for your reply.

This is exactly what I need, I didn't know I could use Day from hierarchy, still need to learn more about PBI. Anyways, if your way is using a filter, how to make it automatically following the latest date of the current month in my data? I'm still searching for how to make the formula for it. 
But totally, your solution makes me easier to go to the next step.

@Anonymous yeah, Power BI is pretty powerful and is far more simple to use than we often think.  

 

My sincere apologies, however, I am just trying to get a better understanding of what you are wanting to achieve.  Are you aiming to return the most current day such as "TodaysDay = DAY ( TODAY () )" or are you aiming to return the most recent Date in all of your Date column such as "LastDate = LASTDATE ( 'Table'[Date] )" or possibly the Day of the most recent date such as "Most Recent LastDate = DAY ( LASTDATE ('Table'[Date] ) )"?

 

If the above is not what you were hoping for, please let me know and I will do my best to help out 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Anonymous
Not applicable

@TheoC maybe the "Most Recent LastDate = DAY ( LASTDATE ('Table'[Date] ) )", from that formula will return the date number from my date, right? I guess that could work to automatically filter the chart based on the recent last date from my data and applied it to each month in the chart. 

I'm sorry if my explanation is quite confusing, hard for me to put it in words.

@Anonymous please do not apologise at all. We all come from amazing and unique backgrounds and are all here on the Microsoft Community to learn and grow in Power BI together 🙂

 

Let me know how the measures go and we can try more if they aren't the right ones 😀

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Anonymous
Not applicable

@TheoC, I'm currently stuck on finding a way not to have to use a Date Filter to get the value for the last recent day of each month.

jonathangabe_1-1634548784658.png

Do I have to create a measure for that or I can do something specific to this can automatically following today's date or the latest date in my data?

 

Hi @Anonymous, you can use TODAY() which will always return today's date. That will automatically update to today's date whereas LASTDATE (Table[Date] ) will return the most recent date in your Date column.

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

amitchandak
Super User
Super User

@Anonymous , Create a measure like

 

=
var _max = maxx(allselected('Date'), 'Date'[Date])
var _min = maxx(allselected('Date'), 'Date'[Date])
return
calculate(sum(Table[Value]), filter('date', 'Date'[Date] >=_min && 'Date'[Date] <=_max && 'Date'[Date] = eomonth(min('Date'[Date]),-1)+1 ))

 

or

 

=
var _max = maxx(allselected('Date'), 'Date'[Date])
var _min = maxx(allselected('Date'), 'Date'[Date])
return
calculate(sum(Table[Value]), filter('date', 'Date'[Date] = eomonth(min('Date'[Date]),-1)+1 ))

 

or

 

calculate(firstnonblankvalue'Date'[Date], sum(Table[Value]))

Anonymous
Not applicable

Hi @amitchandak, thank you for your reply.

I try your 1st formula, but when I put that to the Bar Chart, everything goes blank. Same with the 3rd formula.
I try the 2nd formula, which only shows 1 date data only and I can't change it to other dates by using a filter.

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.