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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Uzi2019
Community Champion
Community Champion

Split data month wise

Hi Experts,
I have 3 columns Date( Continuous Date), Campaign Start Date, Campaign End date.

Uzi2019_0-1662020280982.png


I want month wise split as I mentioned in screenshot.
Please help me to get this done.

Thank you in advance.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
1 ACCEPTED SOLUTION

@Uzi2019 , You can do that power query, expand the same table

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTLXNzTRNzIwMgKyLfWNIcxYnWglkICZvpEFTBLItoTKxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"S N" = _t, #"Start Date" = _t, #"End Date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Start Date", type date}, {"End Date", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "New Start Date", each let 
_s =[Start Date],
_q= List.Select( List.Dates([Start Date], Duration.Days([End Date]-[Start Date])+1,#duration(1,0,0,0)), each _ = List.Max({_s,Date.StartOfMonth(_)}))
in 
_q),
    #"Expanded New Start Date" = Table.ExpandListColumn(#"Added Custom", "New Start Date"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Expanded New Start Date",{{"New Start Date", type date}}),
    #"Added Custom1" = Table.AddColumn(#"Changed Type1", "New End Date", each List.Min({[End Date], Date.EndOfMonth([New Start Date])}))
in
    #"Added Custom1"
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Uzi2019 , Try a new table like

 

 

Table = Distinct(SELECTCOLUMNS(ADDCOLUMNS(GENERATE(Data, CALENDAR([Start Date],[End Date])), "Start Date 1", max(eomonth([Date],-1)+1,[Start Date]) , "End 1", Min(EOMONTH([Date],0), [End Date])), "Start Date", [Start Date], "End date", [End Date],  "New Start", [Start Date 1],"New end", [End 1]))

 

Find the attached file after signature

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 
Thank you for your response.
But I want the result in measure or column.  Need to show againts various different measures and metrics. 
So cant create seperte table fo this.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

@Uzi2019 , You can do that power query, expand the same table

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTLXNzTRNzIwMgKyLfWNIcxYnWglkICZvpEFTBLItoTKxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"S N" = _t, #"Start Date" = _t, #"End Date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Start Date", type date}, {"End Date", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "New Start Date", each let 
_s =[Start Date],
_q= List.Select( List.Dates([Start Date], Duration.Days([End Date]-[Start Date])+1,#duration(1,0,0,0)), each _ = List.Max({_s,Date.StartOfMonth(_)}))
in 
_q),
    #"Expanded New Start Date" = Table.ExpandListColumn(#"Added Custom", "New Start Date"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Expanded New Start Date",{{"New Start Date", type date}}),
    #"Added Custom1" = Table.AddColumn(#"Changed Type1", "New End Date", each List.Min({[End Date], Date.EndOfMonth([New Start Date])}))
in
    #"Added Custom1"
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.