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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
juanma3277
New Member

comparing sums from this month and last month on the same visualization

Hello I'm really new to Power BI and I'm trying to show the sum of trucks for a specific day and the sum of trucks(and count of Id) for the same day last month, on the same visualization to compare them. Below I'm adding some info about the BI. I hope that it's clear enough. Thanks in advance.

Right now I'm getting something like this:

juanma3277_0-1624489217175.png


With this measure:

Prevmonth = CALCULATE(
SUM(Tabla[Trucks]),
FILTER(
Tabla,
MONTH(Tabla[Date Previous Month])=MONTH(TODAY())-1)
)

Thats what I'd need but ideally Prevmonth would return the sum of the previous month instead of the current one.

Id      Date        Date Previous Month   Trucks

128/6/2128/5/21                      2
217/6/2117/5/2110
329/6/2129/5/214
418/6/2118/5/212
529/6/2129/5/215
630/6/2130/5/219
715/6/2115/5/219
825/6/2125/5/219
925/6/2125/5/218
1015/6/2115/5/211
1126/6/2126/5/213
1216/6/2116/5/215
1326/6/2126/5/215
1428/6/2128/5/218
1530/5/2130/4/217
1622/5/2122/4/212
1715/5/2115/4/212
1821/5/2121/4/214
1929/5/2129/4/213
2025/5/2125/4/215
2127/5/2127/4/214
2223/5/2123/4/212
2328/5/2128/4/2110
2415/5/2115/4/218
2522/5/2122/4/218
2615/5/2115/4/217
2721/5/2121/4/212
2818/5/2118/4/211
2920/5/2120/4/219
3016/5/2116/4/219
1 REPLY 1
amitchandak
Super User
Super User

@juanma3277 , with help from date table use a month behind measure

 

example

Month behind Sales = CALCULATE(SUM('Table'[Truck]),dateadd('Date'[Date],-1,Month))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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