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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
PamWren
Frequent Visitor

Adding additional rows to a calculated table

Hi, 

 

I have created a calculated table using select Selectcolumns.  I want to add addtional rows to this for each month between the start and end date, with the monthly payment populatated for that row.  However I also need an addtional row for the final payment.

 

PamWren_0-1710417214110.png

 

Is there a way to do this in DAX.  I can't use power query as this table doesn't show.

 

Any help greatly appreciated.

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @PamWren 

For the requirement: Add addtional rows to this for each month between the start and end date, with the monthly payment populatated for that row.

You can refer to the following solution.

Sample data 

vxinruzhumsft_0-1710470659105.png

Create a new calculated table.

Table 2 =
VAR a =
    SUMMARIZE (
        ADDCOLUMNS (
            CALENDAR ( MIN ( 'Table'[Startdate] ), MAX ( 'Table'[EndDate] ) ),
            "Month", DATE ( YEAR ( [Date] ), MONTH ( [Date] ), 1 )
        ),
        [Month]
    )
VAR b =
    SUMMARIZE ( 'Table', [Startdate], 'Table'[EndDate], [Monthly Payment] )
RETURN
    FILTER (
        CROSSJOIN ( a, b ),
        EOMONTH ( [Month], 0 ) >= EOMONTH ( [Startdate], 0 )
            && EOMONTH ( [Month], 0 ) <= EOMONTH ( [EndDate], 0 )
    )

Output

vxinruzhumsft_1-1710470815192.png

For the second requirement: need an addtional row for the final payment

You can consider to use a matrix visual or table visual it can sum the totalpayment at final.

e.g 

vxinruzhumsft_2-1710471015445.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

1 REPLY 1
v-xinruzhu-msft
Community Support
Community Support

Hi @PamWren 

For the requirement: Add addtional rows to this for each month between the start and end date, with the monthly payment populatated for that row.

You can refer to the following solution.

Sample data 

vxinruzhumsft_0-1710470659105.png

Create a new calculated table.

Table 2 =
VAR a =
    SUMMARIZE (
        ADDCOLUMNS (
            CALENDAR ( MIN ( 'Table'[Startdate] ), MAX ( 'Table'[EndDate] ) ),
            "Month", DATE ( YEAR ( [Date] ), MONTH ( [Date] ), 1 )
        ),
        [Month]
    )
VAR b =
    SUMMARIZE ( 'Table', [Startdate], 'Table'[EndDate], [Monthly Payment] )
RETURN
    FILTER (
        CROSSJOIN ( a, b ),
        EOMONTH ( [Month], 0 ) >= EOMONTH ( [Startdate], 0 )
            && EOMONTH ( [Month], 0 ) <= EOMONTH ( [EndDate], 0 )
    )

Output

vxinruzhumsft_1-1710470815192.png

For the second requirement: need an addtional row for the final payment

You can consider to use a matrix visual or table visual it can sum the totalpayment at final.

e.g 

vxinruzhumsft_2-1710471015445.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.