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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
aJ2
Helper I
Helper I

Comparison of Revenue between same date range in the previous month

Hi  guys.

 

I am facing an issue of  finding out the difference in the revenue between the date range in the previous month.

 

I want the difference and percentage change in revenue between April 1 and April 10 with March 1 and March 10 with February 1 and February 10 and so on.

For eg:-

     Jan 2018                              Feb 2018                    March 2018                                  April 2018

Rev    %change                 Rev    %change          Rev           %change                         Rev          %change

45          -10%                    25          -44%             30                 20%                            41                36%

 

 

Any help would be highly appreciated.

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @aJ2

 

You could follow the steps to get the output below.

 

 

 Captyure.PNG 

1.You should create a Calendar table with the formular below and create the relationships between of the two tables.

 

Calendar = CALENDARAUTO()

2. Create the calculated column Day in the Calendar table.

 

Day = DAY([Date])

3. Create the measure with the formula below to get the difference.

 

difference =
VAR Only10DaysThisMonth =
    CALCULATE (
        SUM ( Reve[revenue] ),
        FILTER ( 'Calendar', 'Calendar'[Day] >= 1 && 'Calendar'[Day] <= 10 )
    )
VAR Only10daysLastMonth =
    CALCULATE (
        SUM ( Reve[revenue] ),
        PREVIOUSMONTH ( 'Calendar'[Date] ),
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Day] >= 1 && 'Calendar'[Day] <= 10 )
    )
RETURN
    Only10DaysThisMonth - Only10daysLastMonth

4. Create the measure below to get the change percent.

 

percent change =
DIVIDE (
    [difference],
    CALCULATE (
        SUM ( Reve[revenue] ),
        FILTER ( 'Calendar', 'Calendar'[Day] >= 1 && 'Calendar'[Day] <= 10 )
    )
)

 

In addition, you could have a reference of my test pbix file.

 

Hope it can help you!

 

If you need additional help please share some data sample and expected output.You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.)

 

Best Regards,

Cherry

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

Thanks Cherry for your response.

 

I guess you have taken a static date range.

I am working with a date slicer. So whenever I change the date range from April 1-April 15, then it should show for 1-15 Jan vs 1-15 Feb vs 1-15 March vs 1-15 April.

When the date range is changed from April 10-April 15, then it should show for 10-15 Jan vs 10-15 Feb vs 10-15 March vs 10-15 April.

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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