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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Post Prodigy

## How to concatenate two fields and apply a rating to them

I need to concatenate my month field with the year and let them in ascending order, Jan / 2008 fev2008 etc ....

I tried a simple concatenation and then apply the classification but did not work

Here is an example for clarity:

12 REPLIES 12
Super User

I generally create a column like:

`= FORMAT([Date],"yyyymm") `

And then use that as my Sort By column for the friendly display name column.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Post Prodigy

I forgot to say that the fields are from different tables, the way to do it would be the same?

Super User

*should* 🙂 You would want to create your new "sort by" column in the same table as your date display field.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Community Champion

@vitexo87 You'll have to use the function RELATED(TableName[Column]) for one of them

Community Champion

@vitexo87 if you are in Table 1 doing this

= Table1[Column1]&" - "&RELATED(Table2[Column2])

Let me know if this works.

Post Prodigy

the following error is occurring:

"Unable to determine a single value for the 'Month' column in the 'dmegf_mes' table. This can happen when a measure formula refers to a column that contains many values, without specifying an aggregation such as min, max, count or sound for a unique result. "

my expression: = NewColumn dmegf_mes [Month] & "-" & RELATED (dmegf_ano [Year])

Community Champion

@vitexo87 Hit Create New COLUMN - NOT Measure!

Post Prodigy

@Sean

that's what I'm doing, I'm going the option to create a new column and not measured

Community Champion

@vitexo87

NewColumn  =  dmegf_mes [Month] & "-" & RELATED (dmegf_ano [Year])

Post Prodigy

@Sean

the same error still occurs,

"Could not determine a single value for the 'month' column in the 'dmegf_mes' table. This can happen when a measurement formula refers to a column that contains many values, without specifying an aggregation such as min, max, count or sound for a unique result. "

Community Champion

@vitexo87 show me what's in both columns - select each and show me whats in them (formula bar and data type)

the formula works - look

Community Champion

@vitexo87

Create a New Column= TableName[Month]&" - "&TableName[Year]

this will give you => Month - Year

## Helpful resources

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Join our Community Sticker Challenge

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

#### Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors