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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
BratKat
Microsoft Employee
Microsoft Employee

Concatenate columns when calculating

Creating a Slicer for weeks and this works if I only use DATE 

Working 

Slicer2 =
var _start_date = CALCULATE(MIN('Work Items'[Team Date 01].[Date]),FILTER('Work Items','Work Items'[weeknum]=EARLIER('Work Items'[weeknum])))

var _end_date = CALCULATE(MAX('Work Items'[Team Date 01].[Date]),FILTER('Work Items','Work Items'[weeknum]=EARLIER('Work Items'[weeknum])))
return
_start_date &" - "& _end_date

 

trying to add Year to this column but throws a error, not sure if I can concatenate. 

 

Slicer2 =
var _start_date = CALCULATE(MIN('Work Items'[Team Date 01].[Year]) & "" & ('Work Items'[Team Date 01].[Date]),FILTER('Work Items','Work Items'[weeknum]=EARLIER('Work Items'[weeknum])))

var _end_date = CALCULATE(MAX('Work Items'[Team Date 01].[Year]) & "" & ('Work Items'[Team Date 01].[Date]),FILTER('Work Items','Work Items'[weeknum]=EARLIER('Work Items'[weeknum])))
return
_start_date &" - "& _end_date

 

Thank you 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @BratKat ,

Is it possible to try to bring up the year?

Like this:

Fiscal Quarter =
VAR _1 =
    IF (
        'Work Items'[Quarters] = 3,
        1,
        IF (
            'Work Items'[Quarters] = 4,
            2,
            IF ( 'Work Items'[Quarters] = 1, 3, IF ( 'Work Items'[Quarters] = 2, 4 ) )
        )
    )
VAR _2 =
    YEAR ( table[date] )
RETURN
    _2 & " " & _1

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @BratKat ,

Please have a try.

Slicer2___ =
VAR _start_date =
    CALCULATE (
        MIN ( 'Work Items'[Team Date 01].[Year] ) & ""
            & MIN ( 'Work Items'[Team Date 01].[Date] ),
        FILTER (
            'Work Items',
            'Work Items'[weeknum] = EARLIER ( 'Work Items'[weeknum] )
        )
    )
VAR _end_date =
    CALCULATE (
        MAX ( 'Work Items'[Team Date 01].[Year] ) & ""
            & MAX ( 'Work Items'[Team Date 01].[Date] ),
        FILTER (
            'Work Items',
            'Work Items'[weeknum] = EARLIER ( 'Work Items'[weeknum] )
        )
    )
RETURN
    _start_date & " - " & _end_date

If it still does not help, please provide you sample data about [Team Date 01].

 

vrongtiepmsft_0-1683685248157.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I actually used the incorrect column code for what am trying to achive. 

This is the actual column code using 

Fiscal Quarter = IF('Work Items'[Quarters]=3,1, IF('Work Items'[Quarters]=4,2, IF('Work Items'[Quarters]=1,3, IF('Work Items'[Quarters]=2,4))))
 
This works as I showed in the screenshot I provided prevously. 
BratKat_0-1683735783938.png

Just trying to add the Year along wih the Quarter number as quarter 2 is 2022 - our fiscal quaters start in July, sorry about the mix up on my end. 

 

 
Anonymous
Not applicable

Hi @BratKat ,

Is it possible to try to bring up the year?

Like this:

Fiscal Quarter =
VAR _1 =
    IF (
        'Work Items'[Quarters] = 3,
        1,
        IF (
            'Work Items'[Quarters] = 4,
            2,
            IF ( 'Work Items'[Quarters] = 1, 3, IF ( 'Work Items'[Quarters] = 2, 4 ) )
        )
    )
VAR _2 =
    YEAR ( table[date] )
RETURN
    _2 & " " & _1

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

BratKat
Microsoft Employee
Microsoft Employee

The slicer returned works however there is no year listed only the Fiscal quarter and our data starts last October, so trying to denote which year the quarter is showing. 

BratKat_0-1683585172308.png

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.