Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin 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.
Hi Power Bi community
I want to expand my table with a lot more rows depending on values in some of the tabels columns.
I have the following columns:
1. Index (an index column)
2. Interval (a text column with the text "Annually", "Weekly" or "Daily"
3. Startdate (a date column that says when to start)
4. Enddate (a date column that says when to end)
If a row's interval value is Annually I need a row for each year between the start date and the end date
If a row's interval value is Weekly I need a row for each week between the start date and the end date
If a row's interval value is Daily I need a row for each day between the start date and the end date
Can some help me in the right direction?
All help is greatly appreciated.
Solved! Go to Solution.
Hi,
Add a new column
if [Interval]="Annually" then {Date.Year([Startdate])..Date.Year([Enddate])}
else if [Interval]="Weekly" then List.Dates([Startdate], Duration.Days([Enddate]-[Startdate])/7,#duration(7,0,0,0))
else if [Interval]="Daily" then List.Dates([Startdate], Duration.Days([Enddate]-[Startdate]),#duration(1,0,0,0))
else null)
Stéphane
Hi,
Add a new column
if [Interval]="Annually" then {Date.Year([Startdate])..Date.Year([Enddate])}
else if [Interval]="Weekly" then List.Dates([Startdate], Duration.Days([Enddate]-[Startdate])/7,#duration(7,0,0,0))
else if [Interval]="Daily" then List.Dates([Startdate], Duration.Days([Enddate]-[Startdate]),#duration(1,0,0,0))
else null)
Stéphane
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
8 | |
6 | |
6 | |
6 |