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
Anonymous
Not applicable

Divide numbers from different dates

Hello,

I would like to have one measure which divides Vol 1 numbers by Vol 2 numbers in the same month periods.

Do you know how to create such a mesure? Tried already with calculate but couldn't solve that.

 

Thanks

Newuser13_0-1666702457137.png

 

2 ACCEPTED SOLUTIONS

@Anonymous , With help from a date table, joined with your date of table/s and date tbale columns used on axis/slicer etc

 

use trailing measure

3 Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-3,Year))

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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

View solution in original post

Anonymous
Not applicable

Ok, I solved that.

Added additional column in calander table: DATEDIFF(Z_Calendar[Date],01/01/2019,YEAR)
And then replaced "-3" with 
SUM(Z_Calendar[Datediff covid])

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Anonymous , one data is available in 2019, another one in 2022, remove year from visual , they will come in the same month

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
Anonymous
Not applicable

Thanks @amitchandak for the answer. It works but actualy my final goal is to have a chart like below where I have to show year 2022. Vol 1 / Vol 2 = infinity so I think it is necessary to solve that inside a measure.

Newuser13_0-1666704685424.png

 

Anonymous
Not applicable

@amitchandak 
On the screenshot there is only 2022 but I have also forcast data for 2023 which I have to show on the chart so can't remove a year.

@Anonymous , With help from a date table, joined with your date of table/s and date tbale columns used on axis/slicer etc

 

use trailing measure

3 Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-3,Year))

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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
Anonymous
Not applicable

@amitchandak thank you for your help! Just one additional question. Do you know if it is possible to make "-3" from the formula dynamic? Because for 2022 it shows data for 2019 but for 2023 it shows 2020 but I also need 2019.

Anonymous
Not applicable

Ok, I solved that.

Added additional column in calander table: DATEDIFF(Z_Calendar[Date],01/01/2019,YEAR)
And then replaced "-3" with 
SUM(Z_Calendar[Datediff covid])

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