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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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