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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
DataNinja777
Super User
Super User

Shorthand for consecutive max balance dates in ConcatenateX

Hello Power BI community,

 

I am trying to assess the appropriateness of the credit limits given to customers and in order to do so, I have identified the maximum daily AR balance in recent years, and to accompany the max AR balance formula, I've identified the dates of the max AR balances for each customer.

DataNinja777_0-1702799678910.png

For some of the customers, concatenateX max dates could be a long list of consecutive dates, and I am wondering if I can express those consecutive dates simply as m/d/yyyy - m/d/yyyy instead of list of dates as shown below.  I'd greatly appreciate it if anyone could let me know how I can tweak the formula above to shorten the text output of max consecutive dates.  

DataNinja777_1-1702799803577.png

Thank you.

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

pls try this

Max Day =
VAR viable = VALUES('calendar'[Date] )
VAR MaxDailyAR = [Max daily AR]
VAR Keepmax = FILTER( viable, [AR since Oct 2020] =MaxDailyAR )
VAR max.day = IF (
    MaxDailyAR > 0,
    IF (
        COUNTROWS ( Keepmax ) > 1,
        MINX ( Keepmax, [Date] ) & "-"
            & MAXX ( Keepmax, [Date] ),
        MINX ( Keepmax, [Date] )
    )
)
RETURN
max_day

View solution in original post

2 REPLIES 2
Ahmedx
Super User
Super User

pls try this

Max Day =
VAR viable = VALUES('calendar'[Date] )
VAR MaxDailyAR = [Max daily AR]
VAR Keepmax = FILTER( viable, [AR since Oct 2020] =MaxDailyAR )
VAR max.day = IF (
    MaxDailyAR > 0,
    IF (
        COUNTROWS ( Keepmax ) > 1,
        MINX ( Keepmax, [Date] ) & "-"
            & MAXX ( Keepmax, [Date] ),
        MINX ( Keepmax, [Date] )
    )
)
RETURN
max_day

Thank you @Ahmedx .  It works, although non-consecutive days are minxed and maxxed even though they are not consecutive, but I guess many patchy concatenated texts of m/d/yyyy-m/d/yyyy will not make it easier to understand so I will stick with this solution.   Thanks a lot.  

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors