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
Grimfandango227
Frequent Visitor

Combining two columns with conditions

Hello, 

 

I am trying to combine two columns where it will give me the Day of year # and the day of week name. 

The issue is I have some pre-calculations that determine the state of the row to be "Future" or "Late" if this is the case I do not want to combine the columns. 

 

So only combine the "Daily State" and "Day Name" if the "Daily State" value does not equal "Future" or "Late" 

 

See the screenshot below for reference. 

 

Grimfandango227_0-1713386321142.png

 

Any help would be greatly appreciated.

 

Thanks!

 

Jeremy

 

 

2 ACCEPTED SOLUTIONS

Hi @Grimfandango227 

or in DAX

Combine = IF([Daily State] = "Future" || [Daily State] = "Late", "", [Daily State] & " " & [Day Name])

 

mahenkj2_1-1713398904244.png

Convert both column in text before going for DAX.

 

Hope it helps.

View solution in original post

Hi @Grimfandango227 ,

 

Perhaps you could test:

NewCombine = IF([Daily State] = "Future" , "Future", IF([Daily State] = "Late", "Late", [Daily State] & " " & [Day Name]))

Hope it helps.

View solution in original post

7 REPLIES 7
mahenkj2
Solution Sage
Solution Sage

HI @Grimfandango227 ,

 

In Power query try as below:

if [Daily State]="Future" or [Daily State]="Late" then "" else [Daily State]&[Day Name]

mahenkj2_0-1713398406686.png

 

Hope it helps.

Hello @mahenkj2 ,

 

Thanks for the help, this worked! Although I am wondering, is there a way to still return "Future" and "Late" into that new column just without the number?

 

See screenshot below, 

 

Grimfandango227_0-1713456265837.png

 

Thanks!

 

Jeremy

 

Hi @Grimfandango227 ,

 

Perhaps you could test:

NewCombine = IF([Daily State] = "Future" , "Future", IF([Daily State] = "Late", "Late", [Daily State] & " " & [Day Name]))

Hope it helps.

Hi @Grimfandango227 

or in DAX

Combine = IF([Daily State] = "Future" || [Daily State] = "Late", "", [Daily State] & " " & [Day Name])

 

mahenkj2_1-1713398904244.png

Convert both column in text before going for DAX.

 

Hope it helps.

fieldsl
New Member

In your Logic Test change the 'Or' to an 'And' 

Option 1
State Combo = IF([Daily State] <> "Future" && [Daily State] <> "Late", [Daily State] & " " & [Day Name], "")

Option 2
State Combo = IF(AND([Daily State] <> "Future", [Daily State] <> "Late"), [Daily State] & " " & [Day Name], "")
Greg_Deckler
Community Champion
Community Champion

@Grimfandango227 In Power Query that should be:

= if [Daily State] <> "Future" or [Daily State] <> "Late" then [Daily State] & " " & [Day Name] else null

in DAX

IF([Daily State] <> "Future" || [Daily State] <> "Late", [Daily State] & " " & [Day Name], BLANK() )



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Good Afternoon @Greg_Deckler ,

 

Thanks for the response! Although it does not appear to be working. (See screenshots below)

 

Grimfandango227_0-1713389454197.png = DAX

 

Outcome ↓↓

 

Grimfandango227_1-1713389488891.png

 

It would appear that I am still getting the day name with "Future" and "Late" States. 

 

Thanks again for the help!

 

Jeremy

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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