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
JacktheYeti
Helper I
Helper I

Calculate Duration between Two Dates. And Totals per each month Number during that Duration

Hello!

 

I've used DATEDIFF to calculate the number of months (duration) of a campaign, but I'm wondering if it's possible to get the month number from that duration?

 

For example: If a campaign runs for 5 months, is there a way I can display months 1 - 5 from that duration. 

 

I'm working on creating a distribution that shows a Sales Campaign data over time (months). My goal is to be able to point to the distribution to illustrate that during the first/middle/last 'x' months of any campaign's duration, 'y' % of sales occured

 

1 ACCEPTED SOLUTION

Hi,

The are mistakes in your expected result.  I think the correct result should be what you see in my image below.  You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello !

 

The first two tables are examples of data tables lcose to what I'm working with. The Third table is the desired table. Thanks for your help.

 

Campaign Table

 

CampaignStart DateEnd Date
Bundle A1/1/192/1/19
Bundle B5/1/1910/1/19
Bundle C3/1/197/1/19

 

Redemption Table

CampaignRedemption DateRedemptionCount
Bundle A1/15/192
Bundle A1/29/1928
Bundle A1/30/1930
Bundle A2/5/1920
Bundle A2/6/1927
Bundle B5/1/1915
Bundle B5/10/1915
Bundle B6/2/1925
Bundle B6/5/1975
Bundle B7/15/1924
Bundle B7/22/1916
Bundle B8/10/193
Bundle B9/1/191
Bundle C4/10/1925
Bundle C4/12/1925

Expected Table (Result) 

CampaignTotal Campaign Duration  (Months)Duration Breakout (Month)RedemptionCount
Bundle A2130
Bundle A2277
Bundle B5130
Bundle B52100
Bundle B5340
Bundle B543
Bundle B551
Bundle C310
Bundle C3250
Bundle C330

Hi,

The are mistakes in your expected result.  I think the correct result should be what you see in my image below.  You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.