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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Mohammed-
Resolver I
Resolver I

IF Statemenr Based in 2 column differnt Type

Hi ,

 How to Convert This DAX Code to add custom column in power query

 

 Acc Lev 2 = SWITH(TRUE( ),
                    F0901[GMOBJ] =1101 && F0901[GMSUB] =1000 , "A/R & Others",
                    F0901[GMOBJ] =1101 && F0901[GMSUB] =2000 ," A/R & Others",
F0901[GMOBJ] =1101 && F0901[GMSUB] =2500 ," A/R & Others",
F0901[GMOBJ]=1101 && F0901[GMSUB]<1000 && F0901[GMOBJ]<1130 ,"Cash&Banks",
       
Please notes GMOBG Column type Whole Number & GMSUB Column Type Text
1 ACCEPTED SOLUTION
Mohammed-
Resolver I
Resolver I

Hi @PijushRoy 

Thanks for your replay  and i am so sorry for delay  you   the problem ther is some Account include text  any way i changed  the type 

thank you very much

View solution in original post

2 REPLIES 2
Mohammed-
Resolver I
Resolver I

Hi @PijushRoy 

Thanks for your replay  and i am so sorry for delay  you   the problem ther is some Account include text  any way i changed  the type 

thank you very much

PijushRoy
Super User
Super User

Hi @Mohammed- 

Please change Datatype of the GMSUB text to number in PQ
Then use below formula in Custom Column

= if [GMOBJ]=1101 and [GMSUB]=1000 then "A/R & Others" else if [GMOBJ]=1101 and [GMSUB]=2000 then "A/R & Others" else if [GMOBJ]=1101 and [GMSUB]=2500 then "A/R & Others" else if [GMOBJ]=1101 and [GMSUB]<1000 and [GMOBJ]<1130 then "Cash&Bank" else null

Change the logic as per your requirement, I hope you find the logic

Please revert change Datatype of the GMSUB number to text in PQ

If solved your requirement, please mark this answer as SOLUTION.
If this comment helps you, please THUMBS UP 👍 this comment


Thanks
Pijush

Follow www.MyAccountingTricks.com 
Youtube - https://www.youtube.com/channel/UCWWGZXYYq_TmV6UPiC3ujkQ





Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors