Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello, im having difficulties understanding the CONTATENATEX formula. I am a complete beginner in this code writing world but i need the formula to conjoin two columns into one for my studies project.
My task is to conjoin columns "Year" and "Month number" into a new column that would join those together showing a year and month together, respectively 202101, 202102 etc. Im just confused about where in the code should i put the formula and what to write in it. Any help will be appreciated! (Look at the picture below for the table and code)
Solved! Go to Solution.
Date =
ADDCOLUMNS (
CALENDARAUTO (),
"Year", YEAR ( [Date] ),
"Month", FORMAT ( [Date], "mmmm" ),
"Month Number", MONTH ( [Date] ),
" Year Month Number",
YEAR ( [Date] ) * 100
+ MONTH ( [Date] )
)
Date =
ADDCOLUMNS (
CALENDARAUTO (),
"Year", YEAR ( [Date] ),
"Month", FORMAT ( [Date], "mmmm" ),
"Month Number", MONTH ( [Date] ),
" Year Month Number",
YEAR ( [Date] ) * 100
+ MONTH ( [Date] )
)
Hey, thank you very much Tamer, really saved my day! Kudos to You!
Hi @stefans124
Just add anew line inside ADDCOLUMNS
" Year Month Number", YEAR ( [Date] ) * 100 + MONTH ( [Date] )
Date =
ADDCOLUMNS (
CALENDARAUTO(),
"Year", YEAR([Date]),
"Month", FORMAT([Date], "mmmm"),
"Month Number", MONTH([Date])
)
(this is the code written)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
10 | |
9 | |
9 |
User | Count |
---|---|
15 | |
12 | |
12 | |
11 | |
11 |