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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Spotto
Helper IV
Helper IV

Validate two data types on the same column in Power Query

Hi everyone, I need some help, I have a table with several records where I need to validate the TYPE column with the following criteria:

 V4 >X0 then V4+X0+ZK
 V4 < X0 then X0-V4+ZK

 

Spotto_1-1676550833163.png

** in this case V4 < X0 then X0-V4+ZK

I need to create the formula (rule) in the POWER QUERY that brings me the final value = 12166,88

 

Spotto_2-1676552372989.png

** in this case  V4 >X0 then V4+X0+ZK then the result would be = 24144,48

 

Could someone help me to do this in power query?
thank you all 🙂

1 ACCEPTED SOLUTION
AlexanderPrime
Solution Supplier
Solution Supplier

I'd recommend Pivoting both the TIPO and VALOR_DIVDA columns in Power Query, That way you'd get ZK / V4/ X0 columns that you could then do your basic math checks against by adding a new calculated column and doing your IF statement

 

AlexanderPrime_0-1676554281950.png

AlexanderPrime_1-1676554294058.png

 

 


Please note - I am not affiliated with Microsoft, I'm just an end user like yourself.
Just a regular guy doin' Data Science.

If my post has helped you, please don't forget to thumbs up or click "Accept as solution" if it solved your problem!

View solution in original post

1 REPLY 1
AlexanderPrime
Solution Supplier
Solution Supplier

I'd recommend Pivoting both the TIPO and VALOR_DIVDA columns in Power Query, That way you'd get ZK / V4/ X0 columns that you could then do your basic math checks against by adding a new calculated column and doing your IF statement

 

AlexanderPrime_0-1676554281950.png

AlexanderPrime_1-1676554294058.png

 

 


Please note - I am not affiliated with Microsoft, I'm just an end user like yourself.
Just a regular guy doin' Data Science.

If my post has helped you, please don't forget to thumbs up or click "Accept as solution" if it solved your problem!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.