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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Dev_Pat
Frequent Visitor

DAX for Year in Calculated Column

Hi Team,

I need a help to develop a DAX as calculated column .

Below is the detail requirement. Any help much appriciated.

 

I have data of last 4 year (2018-Jan to 2021-May) in rows shown below. Required a calculated column, which will give me 2019 volume number to respective month errecpective of any year in the row.

 

Below is a sample table.

 

 Volume2019 Volume
5/1/202161.95 
4/1/202179.90 
3/1/202177.82 
2/1/202131.26 
1/1/202173.70 
12/1/202023.29 
11/1/202031.01 
10/1/202032.62 
9/1/202096.02 
8/1/202057.03 
7/1/202092.29 
6/1/202044.06 
5/1/202069.18 
4/1/202036.51 
3/1/202040.27 
2/1/202048.76 
1/1/202020.02 
12/1/201957.93 
11/1/201979.38 
10/1/201919.48 
9/1/201919.13 
8/1/201920.03 
7/1/201935.74 
6/1/201955.23 
5/1/201997.64 
4/1/201935.52 
3/1/201968.00 
2/1/201937.86 
1/1/201958.07 
12/1/201895.56 
11/1/201864.16 
10/1/20184.02 
9/1/201876.18 
8/1/201851.35 
7/1/201834.06 
6/1/201894.95 
5/1/201869.14 
4/1/201845.19 
3/1/201880.90 
2/1/201817.84 
1/1/201847.14 
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Picture1.png

 

2019 Volume CC =
VAR _currentrowmonth =
MONTH ( Data[Date] )
VAR _resulttable =
SELECTCOLUMNS (
FILTER (
Data,
YEAR ( Data[Date] ) = 2019
&& MONTH ( Data[Date] ) = _currentrowmonth
),
"@result", Data[Volume]
)
RETURN
_resulttable

 

 

Link to the PBIX file 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Picture1.png

 

2019 Volume CC =
VAR _currentrowmonth =
MONTH ( Data[Date] )
VAR _resulttable =
SELECTCOLUMNS (
FILTER (
Data,
YEAR ( Data[Date] ) = 2019
&& MONTH ( Data[Date] ) = _currentrowmonth
),
"@result", Data[Volume]
)
RETURN
_resulttable

 

 

Link to the PBIX file 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi Kim,

 

Thanks for quick revert.

I'm getting an issue saying "A table of multiple values was supplied where a single value was expected".

i think because I have two more column before date column.

1. Market

2. Category

 

Could you help in modifying the current dax please?

 

A great thanks for your help.

 

 

wdx223_Daniel
Super User
Super User

=sumx(filter(table,format(table[date],"yyyymm")=format(earlier(table[date]),"2019mm")),table[volumne])

Hi Daniel,

Thanks for quick revert.

After using the dax I'm getting blank cell.

i think because I have two more column before date column.

1. Market

2. Category

 

Could you help in modifying the current dax please?

Thanks

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.