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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
wpf_
Post Prodigy
Post Prodigy

I am not able to concatenate two measures correctly

I have two measures: Minutes and Seconds, and I want to have a third measure that combines them to give me the time.  This is what I have:  Concat = Table[Minutes] & ":" Table[Seconds]
 
However, when I apply it, nothing shows up but the colon :
It even blanked out the Minutes and Seconds in the matrix.    When I use VALUE it combines them, but I need to add the colon between them. 
 
 
1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @wpf_ ,

 

We create a sample and use the following measure to get the result.

 

Concat = CONVERT([Minutes],STRING)&":"&CONVERT([Seconds],STRING)

 

I1.jpg

 

Or you can create three columns to replace the measures.

 

minute Column = MINUTE('Table'[Date/Time])
Second Column = SECOND('Table'[Date/Time])
Concat column = 'Table'[minute Column] &":"& 'Table'[Second Column]

 

I2.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

View solution in original post

6 REPLIES 6
v-zhenbw-msft
Community Support
Community Support

Hi @wpf_ ,

 

We create a sample and use the following measure to get the result.

 

Concat = CONVERT([Minutes],STRING)&":"&CONVERT([Seconds],STRING)

 

I1.jpg

 

Or you can create three columns to replace the measures.

 

minute Column = MINUTE('Table'[Date/Time])
Second Column = SECOND('Table'[Date/Time])
Concat column = 'Table'[minute Column] &":"& 'Table'[Second Column]

 

I2.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

lbendlin
Super User
Super User

Those are columns, not measures.

 

Concat = Table[Minutes] & ":" & Table[Seconds]

 

should work. If you get just the ":"  then your columns have no data.

@lbendlin ,

 

 Do you mean Table[Minutes] and Table[Seconds] are columns?  They are measures that I created.  Why does it not see the measures, but the expression VALUE(Table[Minutes] & Table[Seconds]) sees it?  How can I get around this? Thanks. 

Measures do not have table names.  They have "home tables"  but that is just for convenience. The convention  is that columns use 'table'[column]  syntax and measures use just [measure]

 

Anyway, do the concatenation directly in your measure, or in a new one. 

 

new measure = [Minutes] & ":" & [Seconds]

 

or use FORMAT() in case you want the seonds to always have two digits.

@lbendlin ,

 

It's odd that Table[Minutes]  and Table[Seconds] show up in the intellisense when I start typing my table name that the measures are in, but I do see that [Minutes] and [Seconds] show up as well.  In any case measure = [Minutes] & ":" & [Seconds] still does not work.  Only : shows up.  The strange thing is measure = [Minutes] & [Seconds] works, but I need the colon in there.  Is there something I am overlooking?  Both [Minutes] and [Seconds] are whole numbers.  

Measures work in filter context.  In your case that context seems to be absent at the point of display.

This depends on how you defined the measures in the first place. Sometimes applying an aggregator helps.  MAX([minutes])  instead of just [Minutes]

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.