Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Graph the current Month (day-to-day) with previous Month

Hey there,


First of thanks to the community for their help already. You guys have been awesome!


Now, I am hoping for a solution in a problem that I have just encountered with trying to compare different data over time. I know this has been looked at various times but I was not able to find a fitting solution so far.


1) What I am trying to achieve, is to show Data for the current Month, as well as Data for the previous Month up to the specific date (e.g. January 1 - 26; February 1 - 26 (current month) ). I am using the chicletslicer to slice by Month as shown in the Screenshot. Now, it it possible that todays date is automatically drawn even though i have selected the whole month?


2) Despite getting this up and running what I am also trying to achieve is to have the two values January/Feburary (current month) put into the graph to show the different values ofer a period of the month in a day-to-day view (screenshot). Also, the Values themselve (e.g. 77 & 51 (sum of values for January), are not changing if I choose a bar on the graph. 


I am calculating the previous months values with:


Visitors previous month = CALCULATE(SUM('Table'[Visitors]); PREVIOUSMONTH(Datedimension[Date]))


However i am not able to show it on a day-to-day graph which does have to do with the PREVIOSMONTH, but I am not sure what to use here. I have tried to create a Table with:


same period last month = CALCULATE(SUM('GA_Master 1'[Besucher]);DATEADD('GA_Master 1'[Date];-1;MONTH))


But this is not giving me back any values at all. 


3) I am trying to show the changes in percentage in color (e.g. Red: Negative, Black: Neutral, Green: Positive). Any suggestions?



Bildschirmfoto 2017-02-26 um 13.40.19.png 

Thank you guys in advance for any help! 



For 1) how does this measure look?


I think it should return the value for the same Day of the month for the previous month.


Visitors Last Month = 
var Offset = DAY(EOMONTH(LASTDATE('Table'[Date]),-1))
RETURN =CALCULATE(SUM('Table'[Visitors]),DATEADD('Table'[Date],-Offset,DAY)) 

To learn more about DAX visit :

Proud to be a Datanaut!

Hey @Phil_Seamark,



Thanks a lot. Cut out the '"=" between RETURN and CALCULATE and it is working perfectly! Is there any chance you could give me a quick rundown on the formular and what is actually beeing calculated and how?




Hi @Keha


Good spotting about the = 


I'm sure there are a few approaches but what this does is work out how many days there were in total for the previous month.


So if the date of your current row is the 15th of February, it counts the number of days in January (31) and subtracts this number in days from the 15th of Feb.  You can't subtract a hardcoded because you'll end up on a different day.


Does that help?

To learn more about DAX visit :

Proud to be a Datanaut!

Hey @Phil_Seamark


Splendid! Thanks so much!


Any chance you might have an Idea about the colorcoding? 




In a chart, the color of bar is based on the legend and category on X axis. It's not based on the Value. And you have to set it manually. There's no conditional formatting in chart visuals.







Helpful resources

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors