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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Nora_Hor
Frequent Visitor

How to distinguish campaign waves

Hi! I am working with media campaign data in monthly breakdown. How can I define a certain campaign that was active for few consequtive months without a break? 

Example: Campaign A was onair in Jan-March, than 2 months off, than on again June-July. I want to distinguish these 2 campaigns from each other and than aggregate their data rows with group_by function.

 

Thanks, Nora

7 REPLIES 7
julioms23
Frequent Visitor

new column with an if statement??


@Nora_Hor wrote:

Hi! I am working with media campaign data in monthly breakdown. How can I define a certain campaign that was active for few consequtive months without a break? 

Example: Campaign A was onair in Jan-March, than 2 months off, than on again June-July. I want to distinguish these 2 campaigns from each other and than aggregate their data rows with group_by function.

 

Thanks, Nora


 

Could you give me further help writing the statement? I can't define a statement as i don't know how to refer to previous row/cell. My data set looks like:

Campaign name Year MonthValue
A20182200
A20183415
A20184404
A2018830
A20189660
B20184440
B20185632
B20181030

Thank You very much!

Better with Group By => campaing name =>sum => value.Anotación 2019-09-23 173736.png

Thanks but that's the point: A campaign had 2 separate waves that I need to keep separate during sum. That's my problem 🙂 

dax
Community Support
Community Support

Hi Nore_Hor,

I am not clear about your requirement, so if possible, could you please inform me more detailed information(such as your sample data and expected output)?

Best Regards,
Zoe Zhi

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

Nora_Hor
Frequent Visitor

Hi,

I would aggregate data rows by campaign waves ( one wave = same campaign name, active for consequtive months without a break) So I need a statement or other kind of  solution to distinguish different campaign waves. 

Sample data:

Campaign name Year MonthValue
A20182200
A20183415
A20184404
A2018830
A20189660
B20184440
B20185632
B20181030

 

Expected output:

Campaign name Year Start MonthEnd MonthValue
A2018241019
A201889690
B2018451072
B2018101030

 

Could you please help?

Thanks,

Nora

I don't know how to do it... 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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