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
paris
Helper V
Helper V

If with < formula

Hi All,

 

Please help. For some reason, my date switch month and year every 13th of each month and back again at the begining of month. 

 

correct month=If ([Month]<12,[Day],[Month]) 

 

This does not work and only shows [Day] column in new correct month column. Could you please help!

 

BI1.JPG

 

All the best,

Paris

1 ACCEPTED SOLUTION

hi  @paris 

Just try this simple formula

CorrectDay = IF([Day]>12,[Day],[Month])
CorrectMonth = IF([Day]>12,[Month],[Day])

Result:

1.JPG

 

Regards,

Lin

Community Support Team _ Lin
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

6 REPLIES 6
ryan_mayu
Super User
Super User

@paris 

 

Could you please show the expected result in the excel?

 

newmonth = if('Table'[day]<=12,'Table'[day],if(mod('Table'[day],12)=0,12,mod('Table'[day],12)))

 

I am not sure if I understand your request clearly.

 

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi Ryan

 

Thank you for your response. I am sorry my question was not clear.

Date here is in text format and when I tried to use day and month formular I get wrong data from 1st till 12th of each month. 

I like to correct it by creating new column and want to get answer in yellow. 

Capture3.JPG

All the best,

Paris

 

 

hi  @paris 

Just try this simple formula

CorrectDay = IF([Day]>12,[Day],[Month])
CorrectMonth = IF([Day]>12,[Month],[Day])

Result:

1.JPG

 

Regards,

Lin

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

Hi Lin

Thank you so much for your help!

 

All the best,

Paris

amitchandak
Super User
Super User

@paris , what is expected output

Hallo Amitchandak,

 

I am sorry I was not clear.

Date is in text format. When I used formular to get day and month, I got them wrong so I want to correct like yellow here.

 

Capture3.JPG

 

All the best,

Paris

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.