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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Thomvdw
Frequent Visitor

Generate rows conditionally

Hi Community,

 

I'am working in a calculated table with the following fields:

  • ContractID (numerical value)
  • Accounting period (always the first of the month, e.g. 1-1-2021, 1-2-2021 and so on).
  • Contract end date (can be any date value)
  • Recurring charge

 

Example is:

ContractID - AccountingPeriod - ContractEndDate - MonthlyRecurringCharge

3001 - 1-1-2021 - 31-12-2021 - 30

 

The data consists of around 70000 rows per month.

 

The goal is that it generates rows for every accounting period within the contract end date a row with the recurring charge, for example:

ContractID - AccountingPeriod - ContractEndDate - MonthlyRecurringCharge

3001 - 1-1-2021 - 31-12-2021 - 30

3001 - 1-2-2021 - 31-12-2021 - 30

3001 - 1-3-2021 - 31-12-2021 - 30

3001 - 1-4-2021 - 31-12-2021 - 30

3001 - 1-5-2021 - 31-12-2021 - 30

....

3001 - 1-12-2021 - 31-12-2021 - 30

 

I have come upon some coding in M, but I cant figure out how that works within a calculated table (seems not working as query editor is not available?).

 

Hope there is a solution for this within DAX.

 

Many thanks in advance,

 

Thom

1 REPLY 1
mah_priya94
Helper I
Helper I

Hi @Thomvdw ,

Could you please provide some sample data for the same.?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.