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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
ofeliajesus
Helper I
Helper I

DAX to calculate Month over Month with last year Month

Hello 

 

I have the table
Dim_Date

 

Date_IDDatePeriodEOM Date
2904202129/04/20212021_0430/04/2021
3004202130/04/20212021_0430/04/2021
0105202101/05/20212021_0430/04/2021
0205202102/05/20212021_0430/04/2021
0305202103/05/20212021_0531/05/2021
0405202104/05/20212021_0531/05/2021
0505202105/05/20212021_0531/05/2021
0605202106/05/20212021_0531/05/2021
0705202107/05/20212021_0531/05/2021
0805202108/05/20212021_0531/05/2021
0905202109/05/20212021_0531/05/2021
1005202110/05/20212021_0531/05/2021
1105202111/05/20212021_0531/05/2021
   
2604202226/04/20222022_0430/04/2022
2704202227/04/20222022_0430/04/2022
2804202228/04/20222022_0430/04/2022
2904202229/04/20222022_0430/04/2022
3004202230/04/20222022_0430/04/2022
0105202201/05/20222022_0430/04/2022
0205202202/05/20222022_0531/05/2022
0305202203/05/20222022_0531/05/2022
0405202204/05/20222022_0531/05/2022
0505202205/05/20222022_0531/05/2022
0605202206/05/20222022_0531/05/2022
0705202207/05/20222022_0531/05/2022
0805202208/05/20222022_0531/05/2022
0905202209/05/20222022_0531/05/2022
1005202210/05/20222022_0531/05/2022
1105202211/05/20222022_0531/05/2022
1205202212/05/20222022_0531/05/2022

 

and the table
Table1

Date_IDRegion Amount
29042021California$200.234
30042021North Central$650.235
01052021West$1,140.890
02052021West$2,100.137
03052021California$954.543
04052021California$654.345
05052021North Central$321.654
06052021South Central$234.876
06052021North Central$1,140.890
08052021North Central$2,100.137
08052021South Central$954.543
10052021California$654.345
11052021West$2,100.137
26042022California$200.234
27042022California$650.235
28042022North Central$1,140.890
29042022South Central$2,100.137
30042022North Central$954.543
01052022North Central$654.345
01052022South Central$321.654
01052022California$234.876
04052022West$1,140.890
05052022West$2,100.137
06052022West$200.234
07052022California$650.235
08052022California$1,140.890
09052022North Central$2,100.137
10052022South Central$954.543
11052022North Central$654.345
12052022California$321.654

 

 

Dim_Date and Table1 are joined by Date_ID
There are 12 Periods per year, but they don't exactly match the months of the year. To have a date that can give me the period, I built the column "EOM Date." The original thought was to use date functions, but I need the results broken down by Period like in the example below.

 

RegionLast Year PeriodLast Year's Total AmountCurrent Year PeriodCurrent Year Total Amount% Growth 
California2021_04$200.2342021_04$1,085.345442.04%
California2021_05$2,263.2332021_05$2,112.779-6.65%
Non-California2021_04$2,750.3722021_04$5,171.56988.03%
Non-California2021_05$6,852.2372021_05$7,150.2864.35%
ALL2021_04$2,950.6062021_04$6,256.914112.06%
ALL2021_05$9,115.4702021_05$9,263.0651.62%

 

Any help would be appreciated.

Thank you

1 ACCEPTED SOLUTION

Your expected result is not in a good format. See attached for a proposal on how to present the data.

 

 

View solution in original post

6 REPLIES 6
ofeliajesus
Helper I
Helper I

I give it another try ...

I have 

Dim_Date table 

Date_IDDatePeriodEOM Date
2904202129/04/20212021_0430/04/2021
3004202130/04/20212021_0430/04/2021
0105202101/05/20212021_0430/04/2021
0205202102/05/20212021_0430/04/2021
0305202103/05/20212021_0531/05/2021
0405202104/05/20212021_0531/05/2021
0505202105/05/20212021_0531/05/2021
0605202106/05/20212021_0531/05/2021
0705202107/05/20212021_0531/05/2021
0805202108/05/20212021_0531/05/2021
0905202109/05/20212021_0531/05/2021
1005202110/05/20212021_0531/05/2021
1105202111/05/20212021_0531/05/2021
   
2604202226/04/20222022_0430/04/2022
2704202227/04/20222022_0430/04/2022
2804202228/04/20222022_0430/04/2022
2904202229/04/20222022_0430/04/2022
3004202230/04/20222022_0430/04/2022
0105202201/05/20222022_0430/04/2022
0205202202/05/20222022_0531/05/2022
0305202203/05/20222022_0531/05/2022
0405202204/05/20222022_0531/05/2022
0505202205/05/20222022_0531/05/2022
0605202206/05/20222022_0531/05/2022
0705202207/05/20222022_0531/05/2022
0805202208/05/20222022_0531/05/2022
0905202209/05/20222022_0531/05/2022
1005202210/05/20222022_0531/05/2022
1105202211/05/20222022_0531/05/2022
1205202212/05/20222022_0531/05/2022

 

In the ... space I have other dates but for the results doesn't matter 

and I have 

Table1 

Date_IDRegion Amount
29042021California$200.234
30042021North Central$650.235
01052021West$1,140.890
02052021West$2,100.137
03052021California$954.543
04052021California$654.345
05052021North Central$321.654
06052021South Central$234.876
06052021North Central$1,140.890
08052021North Central$2,100.137
08052021South Central$954.543
10052021California$654.345
11052021West$2,100.137
26042022California$200.234
27042022California$650.235
28042022North Central$1,140.890
29042022South Central$2,100.137
30042022North Central$954.543
01052022North Central$654.345
01052022South Central$321.654
01052022California$234.876
04052022West$1,140.890
05052022West$2,100.137
06052022West$200.234
07052022California$650.235
08052022California$1,140.890
09052022North Central$2,100.137
10052022South Central$954.543
11052022North Central$654.345
12052022California$321.654

The tables are related with Date_ID 

I want to calculate the % of the growth amount for the existing periods between the current year and last year. I know each year can have 12 periods but they don't correspond to normal months to have a date per period I created the EOM Date with this date I can use date functions maybe this helps.
The result that I want

RegionLast Year PeriodLast Year Total AmountCurrent Year PeriodCurrent Year Total AmountPercentage  Growth 
California2021_04$200.2342021_04$1,085.345442.04%
 2021_05$2,263.2332021_05$2,112.779-6.65%
Non California2021_04$2,750.3722021_04$5,171.56988.03%
 2021_05$6,852.2372021_05$7,150.2864.35%
ALL2021_04$2,950.6062021_04$6,256.914112.06%
 2021_05$9,115.4702021_05$9,263.0651.62%

 

 

Thank you 

 

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Ibendlin takes a look at the data, I can create a pbix if you prefer. Thank you 

Your expected result is not in a good format. See attached for a proposal on how to present the data.

 

 

Thank you works 

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.