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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
arnomics
Helper I
Helper I

Calculate revenue forecast in current calendar year

Hi all,

 

I have a tricky calculation that I'm trying to get my head around on. 

 

I have 3 tables - Service, Subscription and Date (Date is a Directquery from DB & is not marked as a Date table)

 

Service table has the Column Service ID, Monthly Price & Service Status (I'm only interested in Active or Inactive status)

Subscription table has the Service Start Date & Service End date (for inactive services)

 

I'm trying to create a Measure that will help me bring in the Calendar Year (with all months in current year) so that I can show total sum of all Active services + Sum of services cancelled in a given month. Also the ability to show them as cumulative over months.

 

The problem I have is the Service ID has a one-off Total Price, it is meant to be monthly recurring charge until the service is made inactive.

 

I've created the below Measure that kind of flags all the service IDs that are either still active or were active at some point of time in current year (i.e services that were cancelled in the current year). But I want to take it to the next step now and use these Service IDs to create a table visual that shows me monthly recurring charge over the current year. 

 

Any help appreciate. Thanks. 

 

Active in Current Year =
CALCULATE (
    MAX ( SERVICE[SERVICE_ID] ),
    TREATAS ( { "Active", "Inactive" }, 'SERVICE'[SERVICE_STATUS] ),
    SERVICE[MONTHLY_PRICE] > 0,
    SERVICE[CANCEL_DATE] >= DATE ( YEAR ( TODAY () ), 2, 1 )
)

 

2023-06-08 23_13_00-datamonth - Excel.png

 

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Share the tables in a format that can be pasted in an MS Excel file.


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

Hi @Ashish_Mathur 

 

Thanks for your help. Please see below. 

 

The challenge for me with DAX measure as I mentioned is because I want to show the list of services that were active in the Current Year or had at least 1 billable day. But I want to use the Price as a Table visual that shows Revenue generated by services in Current Year by month (i.e Jan-Dec). I

Service Table

Service IDPrice (per month)Service Status
1$50Active
2$25Active
3$40Active
4$50Inactive
5$25Active
6$40Active
7$50Active
8$25Active
9$40Active
10$50Active
11$25Inactive
12$40Inactive
13$50Inactive
14$25Active
15$40Active
16$50Inactive
17$25Inactive
18$40Inactive

 

Subscription Table

Service IDService Activation DateService End Date
11/02/2002 
21/09/2010 
32/02/2019 
41/06/20021/12/2016
51/06/2010 
62/12/2019 
71/01/2020 
812/12/2005 
92/02/2019 
101/06/2002 
111/06/20101/07/2015
122/12/201923/02/2023
131/02/20021/04/2023
141/09/2010 
152/02/2019 
168/08/20111/06/2023
179/08/20179/05/2023
181/01/202330/03/2023

Hi,

Please find attached my solution.

Hope this helps.

Untitled.png


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

Thanks @Ashish_Mathur  for taking the time to help out.

 

I just have one problem with this. I'm using a published dataset & as a result cannot create a Calculated Column, like you provided with the solution. 

 

The Subscription table had this Calculated Column - 

Price = RELATED(Service[Price (per month)])
 
With my Model I can only create Measures.  When I try to replicate the solution you helped with, I get the same number across different months. I'm guessing this is because there is no relationship. 20229_45-Window.png

 

I'm guessing this is because there is no relationship. 

Please show your data model.

You are welcome.  Someone else will help you with this.


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

SUMMARIZECOLUMNS over Service_ID and Month, and add a measure that pulls in the monthly revenue if the service_id was active in that month.  Then SUMX the result. 

That could work but I don't know how to show the Price in Current Year as the Price is stored at the Service ID Row level which has an Activation date (Which was in the past). Whereas I'm trying to use this information to show on a table visual what revenue has been generated by Active services in the current year by Month.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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