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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Bar chart displays data of N last months

Hi everyone, 

 

My report should display data of N last months that I could change N

 

The logic is just use data between today() and month(today()) - N

 

There is something wrong that I don't understand is the chart group data of 2 last months then shift just the label of others months. Example : the label is october but when I put the mouse on the bar just on the top of the label, it display data of september

 

I join for you the PIBX here and thank you !

https://drive.google.com/open?id=10saKmfvSFB9JptSTDc_-El-w8Pxi223N 

6 REPLIES 6
GarethWoodhouse
Resolver I
Resolver I

Hi there, can you repost your url for the PBX file as I can not access currently.

 

Thanks.

Anonymous
Not applicable

Hey,

 

Sorry for the error, here is the link and it work now 

https://drive.google.com/open?id=10saKmfvSFB9JptSTDc_-El-w8Pxi223N

 

Right - I can replicate your error using your example.

 

A way to work around it is to use the Date Hierarchy Month dimension.

Doing this I was able to Show October and only October dates are included in your bar.

 

I will investigate more to try and work out why the date itself is dounf this though..

 

 

Found it.

You have the x axis set to Continuous.

If you change this to Categorical if fixes your problem without the need for a workaround.

 

If this fixes your problem please mark with a thumbs up and accept as the solution.

 

Thanks.

Anonymous
Not applicable

Hey, thank you for searching

I tried your solution and I found an error, there is 2 bar and 2 dates for the month of march. 

Could you explain where is the problem from ? 

Your date table holds the day, month and pic2.jpgyear.

 

You have an entry for March 10th and March 29th - hence the 2 entries show as you are using date in the axis.

If you want to display and summarise by Month Year, then create a measure to just bring back month and year from creationsdate and reference that measure in your chart aswell as in your measure "mesure"

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors