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! Learn more

Reply
Urielpc
Frequent Visitor

Create table with dummy transaction

hello,

i have to create new table with dummy transaction base on 

CustomerCreatedDate

Sample:

CustomerName , CreateDate 

John a                , 01/08/2021

 

I need to create a new table with one row per month till current month

John a                , 01/08/2021

John a                , 01/09/2021

John a                , 01/10/2021

John a                , 01/11/2021

John a                , 01/12/2021

 

How can i do this with Dax or M query

thanks

1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@Urielpc  pbix is attached; the DAX uqery is following

Table 2 =
VAR _1 =
    ADDCOLUMNS (
        'Table',
        "lastDate", DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
    )
VAR _2 =
    FILTER (
        GENERATE (
            _1,
            DATESBETWEEN ( 'Calendar'[Date], 'Table'[CreatedDate], [lastDate] )
        ),
        DAY ( [Date] ) = 1
    )
RETURN
    _2

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

2 REPLIES 2
smpa01
Super User
Super User

@Urielpc  pbix is attached; the DAX uqery is following

Table 2 =
VAR _1 =
    ADDCOLUMNS (
        'Table',
        "lastDate", DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
    )
VAR _2 =
    FILTER (
        GENERATE (
            _1,
            DATESBETWEEN ( 'Calendar'[Date], 'Table'[CreatedDate], [lastDate] )
        ),
        DAY ( [Date] ) = 1
    )
RETURN
    _2

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Thanks very much, smpa01 

PREVIEW
 
 
 

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.