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

Maximum or last value of CONCATENATEX variable (MAX does not work)

Hi everyone,

 

Maybe there is a simple answer to my question, but does anybode know how to get the maximum or last value of a CONCATENATEX variable. Unfortunately, MAX(_Concat) does not work (see formula below). The goal is to get the maximum value of slicer 'Month' e.g. When Month 1 till 9 is selected, it needs to return 9.

 

MaxSelectedMonth=

VAR _Concat = CONCATENATEX(VALUES('Invoice Date'[MonthInYear]), 'Invoice Date'[MonthInYear], ", ")
RETURN
MAX(_Concat)
 
Thanks in advance!
1 ACCEPTED SOLUTION
PVO3
Impactful Individual
Impactful Individual

Based on assumptions whatever your data looks like. And assuming 'Invoice Date' is your data table, not your fact table.

 

Easiest solution - create 2 columns in 'Invoice Date'
- [Column1] A concatenaded column of month/year

- [Column2] A numeric value of moth/year (like januari 2021 = 202201)

 

Then create a measure 

Measure =
VAR _max = MAX([Column2])
RETURN
 
CALCULATE(
   MIN([Column1]),
   [Column2] = _max
)
 

View solution in original post

1 REPLY 1
PVO3
Impactful Individual
Impactful Individual

Based on assumptions whatever your data looks like. And assuming 'Invoice Date' is your data table, not your fact table.

 

Easiest solution - create 2 columns in 'Invoice Date'
- [Column1] A concatenaded column of month/year

- [Column2] A numeric value of moth/year (like januari 2021 = 202201)

 

Then create a measure 

Measure =
VAR _max = MAX([Column2])
RETURN
 
CALCULATE(
   MIN([Column1]),
   [Column2] = _max
)
 

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.