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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anduve11
Frequent Visitor

Line and Column Chart - Current Year and PY Problem with end-of-month transition to first-of-month

I have a Line and Column Chart visual on my report.  The column data show's current year visits for the last week and the line chart shows prior year visits during the same time period last year.  On the x-axis I have Day-Of-Month and the y-axis is the sum of total visits.  During the middle of the month the visual looks great.  But at the start of the month the visual doesn't work(see image below).  Any ideas on how to avoid this?  Do i need to do something with the sort order or is it a configuration thing?

 

In my date table I have the following measures created to pull last weeks data and PY last week:

 

Last_Week = Dim_Date[Date] >= Today()-8
PY_Last_Week = DIM_DATE[DATE] >= TODAY()-373 && DIM_DATE[DATE] <= TODAY()-366

And then in my visits table I have these measures created:

 

Week_TotaL_Visits = CALCULATE(SUM(VW_VISITS[TOTAL_VISITS]),DIM_DATE[Last_Week] = TRUE())
PY_Week_Visits = CALCULATE(SUM(PY_VISITS[TOTAL_VISITS]),DIM_DATE[PY_Last_Week] = TRUE())

This is how the visual should look when working:

Middle of MonthMiddle of Month

This is how the visual looks at the beginning of the month:

Screen Shot 2018-02-02 at 10.43.09 AM.png

1 REPLY 1
MFelix
Super User
Super User

Hi @Anduve1,

Instead of calculating the py week try to use the SAMEPERIODLASTYEAR.

Not on computer right now to simulte the measure.

Regards
MFelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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