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

comparison between columns

Guys,

in the M language, how could I get just the month and year of each column so that I can perform a comparison?

For exemplo: 

   (Column data_alteracao_status)         (CreatedDate)

if               11/2022                          <    10/2022    then null 

I would like to compare month and year only, without full date

kasife_1-1682644878503.png

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

in case of no less I wrote "OK". instead you can paste what you want

if
Number.From(Date.ToText(
Date.From([data_alteracao_status]),[Format= "yyyyMM"])) <
Number.From(Date.ToText(
Date.From([CreatedDate]),[Format= "yyyyMM"])) then null else "OK"

Screen Capture #971.png

View solution in original post

2 REPLIES 2
kasife
Helper V
Helper V

@Ahmedx  than you so much

Ahmedx
Super User
Super User

in case of no less I wrote "OK". instead you can paste what you want

if
Number.From(Date.ToText(
Date.From([data_alteracao_status]),[Format= "yyyyMM"])) <
Number.From(Date.ToText(
Date.From([CreatedDate]),[Format= "yyyyMM"])) then null else "OK"

Screen Capture #971.png

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.