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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
akshaydz
Frequent Visitor

chart with start and end date

Hi ,

 

Can any body help to plot a cohort analysis for the below table

 

cohort.PNG

Am trying to generate a detail table which will have the all the months for each customer from start to end. The detail table could be used to generate the cohort chart

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @akshaydz

 

Note : You can combine the below steps as well.

 

1. Create a Calandar table with this formula. You can modify the date range as you need them.

Calendar Date = CALENDAR("2011-01-01","2019-12-31")

 

2. Use this formula in Modelling -> New Table

 

Ex_Generate = 
SELECTCOLUMNS(
FILTER(
      GENERATE('Table1','Calendar Date'),
      'Calendar Date'[Date]>= 'Table1'[Start Date] && 'Calendar Date'[Date]<'Table1'[End Date]
      ),
      "CustID",Table1[CustomeID],
      "StDate",Table1[Start Date],
      "EndDate",Table1[End Date],
      "Date",'Calendar Date'[Date],
      "YearMonth1",CONCATENATE(YEAR('Calendar Date'[Date]),FORMAT(MONTH('Calendar Date'[Date]),"00"))
    )

 

3. If you pull custmer id, and YearMonth column in your visual you will see the required data.

 

Generate 1.PNG 

 

Thanks

Raj

View solution in original post

v-lili6-msft
Community Support
Community Support

Hi,@akshaydz 

Maybe you also can try another method like below

Step 1:

Create a CALENDAR table:

Date = CALENDARAUTO()

Step 2:

Crossjoin those two tables:

Table =
FILTER (
    CROSSJOIN ( Table2, 'Date' ),
    'Date'[Date] >= Table2[start_date]
        && 'Date'[Date] <= Table2[end_date]
)

Step 3:add a column by months:

Column = FORMAT ( 'Table'[Date], "mm" ) & " " & YEAR ( 'Table'[Date] )

NEW TABLE as below:

3.png

drag  fields into visual and result:

2.PNG

Here is demo ,please try it .

https://www.dropbox.com/s/gxa26tlz05t3kjh/chart%20with%20start%20and%20end%20date.pbix?dl=0

 

 

Best Regards,

Lin

Community Support Team _ Lin
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

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

Hi,@akshaydz 

Maybe you also can try another method like below

Step 1:

Create a CALENDAR table:

Date = CALENDARAUTO()

Step 2:

Crossjoin those two tables:

Table =
FILTER (
    CROSSJOIN ( Table2, 'Date' ),
    'Date'[Date] >= Table2[start_date]
        && 'Date'[Date] <= Table2[end_date]
)

Step 3:add a column by months:

Column = FORMAT ( 'Table'[Date], "mm" ) & " " & YEAR ( 'Table'[Date] )

NEW TABLE as below:

3.png

drag  fields into visual and result:

2.PNG

Here is demo ,please try it .

https://www.dropbox.com/s/gxa26tlz05t3kjh/chart%20with%20start%20and%20end%20date.pbix?dl=0

 

 

Best Regards,

Lin

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

Mate, I have been looking for this for a long time and your solution is eloquent. Brilliant! Thank you

Anonymous
Not applicable

Hi @akshaydz

 

Note : You can combine the below steps as well.

 

1. Create a Calandar table with this formula. You can modify the date range as you need them.

Calendar Date = CALENDAR("2011-01-01","2019-12-31")

 

2. Use this formula in Modelling -> New Table

 

Ex_Generate = 
SELECTCOLUMNS(
FILTER(
      GENERATE('Table1','Calendar Date'),
      'Calendar Date'[Date]>= 'Table1'[Start Date] && 'Calendar Date'[Date]<'Table1'[End Date]
      ),
      "CustID",Table1[CustomeID],
      "StDate",Table1[Start Date],
      "EndDate",Table1[End Date],
      "Date",'Calendar Date'[Date],
      "YearMonth1",CONCATENATE(YEAR('Calendar Date'[Date]),FORMAT(MONTH('Calendar Date'[Date]),"00"))
    )

 

3. If you pull custmer id, and YearMonth column in your visual you will see the required data.

 

Generate 1.PNG 

 

Thanks

Raj

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.