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

Concatenate values between a period

I'm trying to get a comma separated list of all the values in a field that relate to an individual time period. There can be multiple overlapping promotions, hence the use of CONCATENATEX().

 

The data model I have is quite simple:

Data Model

 

I can get the exact desired effect as a calculated column in the DateCal table by using the following formula: Current Promotions = CALCULATE(CONCATENATEX(Promotions,Promotions[Promo Name],", "),FILTER(Promotions,Promotions[Begin Date]<=DateCal[Date]&&Promotions[End Date]>=DateCal[Date]))

 

I just can't get the formula to work as a measure so that I can dynamically filter based on date (and add it as a tooltip).

 

What am I missing to get this working?

1 ACCEPTED SOLUTION
sebastian_ebg
Helper I
Helper I

I managed to work this out myself using effectively the same formula. It now works perfectly for what I need it for.
 
Will leave the post here if anyone else has the same question 🙂
 
Promotions =
CALCULATE (
    CONCATENATEX ( Promotions, Promotions[Promo Name], ", " ),
    FILTER ( ALL ( Promotions ), Promotions[Begin Date] <= MAX ( DateCal[Date] ) ),
    FILTER ( ALL ( Promotions ), Promotions[End Date] >= MIN ( DateCal[Date] ) )
)

View solution in original post

1 REPLY 1
sebastian_ebg
Helper I
Helper I

I managed to work this out myself using effectively the same formula. It now works perfectly for what I need it for.
 
Will leave the post here if anyone else has the same question 🙂
 
Promotions =
CALCULATE (
    CONCATENATEX ( Promotions, Promotions[Promo Name], ", " ),
    FILTER ( ALL ( Promotions ), Promotions[Begin Date] <= MAX ( DateCal[Date] ) ),
    FILTER ( ALL ( Promotions ), Promotions[End Date] >= MIN ( DateCal[Date] ) )
)

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.