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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
diederd
Helper II
Helper II

The last 12 Month from Today not displaying correctly on graph

Power BI community,

 

I have the following issue in that I've got some data in which I'm needing to report on; however there is a requirement to display a count of all breaches for the last 12 months (from today). I have a measure which correctly pulls the data; however this is not being correctly displayed on the line graph.

 

totalBreachLastYear = CALCULATE(COUNTROWS('Breaches Log'),DATESBETWEEN ('Calendar'[Date], NEXTDAY ( SAMEPERIODLASTYEAR (LASTDATE ( 'Calendar'[Date] ) ) ),LASTDATE ( 'Calendar'[Date] )))

 

I have data being imported from SharePoint Online, these tables are as follows:

 

  • BreachesLog
  • Calendar
  • TaxonomyHiddenList
  • User Information List

 

Picture1.png

 

These are the results that I'm getting:

 

Picture2.png

 

The data table is correct (showing 20 records for the previous 12 months), however the chart is showing completely incorrect.

 

Any assistance/guidance would be much appreciated.

 

Thank you.

1 REPLY 1
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@diederd,

I note that you use MonthName field to create the chart, which table does the field come from? How about you create a YearMonth field in your table and use it as X-Axis in the chart?

In addition, could you please share sample data of Breaches Log table or PBIX file for us to analyze?

Regards,

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors