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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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