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
MrJames76
Frequent Visitor

Concatenate and summarize a field based on dynamic input

Hi all,

 

I'm trying to figure out if I can pass a date from a date slicer into a measure, calculated field, or calculated table that concatenates the relevant rows and allows me to count/sum other measures.

 

What I have is a data set that lists customer subscriptions for multiple products with start and end dates.

 

Account_NameProductStart_DateEnd_DateARR
AProduct X1/1/202112/31/2021100
AProduct Y5/1/202112/31/202150
BProduct X5/1/20215/30/202260
CProduct Y1/1/202112/31/2021100
DProduct X1/1/202112/31/202160
DProduct Y1/1/202112/31/202180

 

Using a date slicer I can create a measure that summarizes ARR at any point in time:

 

Current_ARR = var _selecteddate = MAX('Dates[Date]) return CALCULATE(SUM(ARR), Start_date <= _selecteddate, End_date >= _selecteddate)

 

What I'd like to be able to do is create a table that summarizes things by product ownership. For example, assuming the date was set to 6/1/2021:

Products_OwnedAccount_CountTotal_ARR
Product X, Product Y2290
Product X160
Product Y1100

 

However, if the date in the slicer changed to 4/1/2021 it would show:

Products_OwnedAccount_CountTotal_ARR
Product X, Product Y1140
Product X2160
Product Y1100

 

I've tried: 

Products_Owned =
var _selecteddate = MAX('Dates'[Date])
return
CALCULATE(
   CONCATENATEX(
      SUMMARIZE(
            Filter(DATA, END_DATE >= _selecteddate && START_DATE <=_selecteddate)
, PRODUCT)
PRODUCT ,", "))

 

However, since it's a measure (I guess) I'd need to have the table showing each customer and am unable to summarize the count of customers against each product combination. Otherwise the output is just all the Products combined.

 

Any thoughts are welcome!

1 ACCEPTED SOLUTION

Hi,

You may download my solution workbook 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

5 REPLIES 5
danextian
Super User
Super User

Hi @MrJames76 ,

By "table", do you mean as a visual or a calculated table? The latter is static and will not change until you modify the formula behind or refresh the dataset.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thanks danextian! I mean as a visual (I think). At it's simplest there are only two elements on the tab/page - a date slicer which defines the specific date I'm interested in, and a table or matrix that shows the product combinations, customer count, and ARR.

Hi,

Is it fair to assume that you will select a particular month (such as April 2021) or do you want to be able to select a spsecific date such as April 23, 2021?  Please clarify.


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

Ideally I can pick a particular date, but if that's not reasonable I could live with a period - would just have to decide on date within the month presents the month (i.e., if a customer cancels on April 15th are they counted in April or not - very much a run-rate analysis vs. a recognized revenue analysis).

Hi,

You may download my solution workbook 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.