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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Varshi288
Resolver II
Resolver II

Delta of Month on Month in tooltip.

Hi  All,

 

I need to find the delta from selected month from previous month. I managed to get the result but it is not working in the tooltip.There are many solutions in the forum but that didnt help me.
Tables : Data , Period 
PryMth.png

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

This approach should work

  1. Create a Calendar Table with calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number
  2. Create a relationship (Many to One and Single) from the Date column of your Fact table to the Date column of the Calendar Table
  3. To your visuals/filters/slicers, drag Year and Month name from the Calendar Table
  4. Write these measures

Total = sum(Data[Sales])

Total in PM = calculate([Total],previousmonth(calendar[date]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Hi  All ,

 

 Thankyou all for your quick response. I used both  PREVIOUSMONTH and DATEADD to get last month sales both are right. And this is working in matrix visual. But in the bar chart Period field was not recagnised as a date column  (2024_6). After changing to proper date format it worked.

Thanks once again.

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

This approach should work

  1. Create a Calendar Table with calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number
  2. Create a relationship (Many to One and Single) from the Date column of your Fact table to the Date column of the Calendar Table
  3. To your visuals/filters/slicers, drag Year and Month name from the Calendar Table
  4. Write these measures

Total = sum(Data[Sales])

Total in PM = calculate([Total],previousmonth(calendar[date]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi  All ,

 

 Thankyou all for your quick response. I used both  PREVIOUSMONTH and DATEADD to get last month sales both are right. And this is working in matrix visual. But in the bar chart Period field was not recagnised as a date column  (2024_6). After changing to proper date format it worked.

Thanks once again.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mickey64
Super User
Super User

Step 0: I use these data below.

mickey64_0-1723268427539.png

 

Step 1: I make a calendar table and add a relationship.

    Calendar = CALENDARAUTO()

mickey64_1-1723268538916.png

 

Step 2: I make a measure and make a matrix.

M_PreYMth TP$ = CALCULATE(SUM('DATA'[CurMth TP$]),PREVIOUSMONTH('Calendar'[Date]))

mickey64_2-1723268603203.png

 

 

 

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.