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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
kkalyanrr
Helper V
Helper V

Adding a Date column to the existing dataset

Hello,

 

I'm trying to add a date column to the dataset(the expected ouput given below).
Can you help me with the DAX expression to acheive the re

IdAmountDateADateB
2987046551610-03-202020-02-2020
29870526206.416-04-202001-04-2020
29870627005.412-05-202023-04-2020
29870767513.501-04-202017-03-2020

 

O/P Table:

 

 

Date MainIdAmountDateADateB
01-01-20202987046551610-03-202020-02-2020
01-01-202029870526206.416-04-202001-04-2020
01-01-202029870627005.412-05-202023-04-2020
01-01-202029870767513.501-04-202017-03-2020
02-01-20202987046551610-03-202020-02-2020
02-01-202029870526206.416-04-202001-04-2020
02-01-202029870627005.412-05-202023-04-2020
02-01-202029870767513.501-04-202017-03-2020
03-01-20202987046551610-03-202020-02-2020
03-01-202029870526206.416-04-202001-04-2020
03-01-202029870627005.412-05-202023-04-2020
03-01-202029870767513.501-04-202017-03-2020
1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@kkalyanrr 

not sure I understand correct what do you need, but maybe create new CROSSJOIN() table will help you:

New Table  = CROSSJOIN('Table', CALENDAR(DATE(2020,1,1), DATE(2020,12,31)))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

6 REPLIES 6
v-diye-msft
Community Support
Community Support

Hi @kkalyanrr 

 

If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly. If not, please kindly elaborate more. thanks!

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

@kkalyanrr , refer if this file can help. This has an example to create dates between two dates. The file is attached after signature

 

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
mahoneypat
Microsoft Employee
Microsoft Employee

If you have additional transformations to do after this step, you can also do this cross join in the query editor.  Please see the M code below that does so with your example data.  Just create a blank query, go to Advanced Editor, and replace the code there with this.

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZY5BCsAwCAT/knMMq4navqXk/99oJK1QepKR2WWvq8h5OEapxVTZ1mUQOgkEC2SBbJj1kTX+JrAWMTbCeHVwQurRKQ7o1oWg2d7/uscUV+5Nv4Ur67lszhs=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Id = _t, Amount = _t, DateA = _t, DateB = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Id", Int64.Type}, {"Amount", type number}, {"DateA", type text}, {"DateB", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Date Main", each List.Dates(#date(2020,1,1), 366, #duration(1,0,0,0))),
#"Expanded Date Main" = Table.ExpandListColumn(#"Added Custom", "Date Main"),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded Date Main",{{"Date Main", type date}})
in
#"Changed Type1"

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


az38
Community Champion
Community Champion

@kkalyanrr 

whats rule to define your new date column?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38  I should start from 1 Jan 2020 to 31 Dec 2020 current calendar year.

az38
Community Champion
Community Champion

@kkalyanrr 

not sure I understand correct what do you need, but maybe create new CROSSJOIN() table will help you:

New Table  = CROSSJOIN('Table', CALENDAR(DATE(2020,1,1), DATE(2020,12,31)))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.