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
AllanBerces
Post Prodigy
Post Prodigy

PQ Multiple IF

Hi good day can anyone help me on my PQ. i have 3 column on my table Hrs, Type No and Mat%.

 - 1st condition -  IF the column Type No is equal to MN then on the result will be the Hrs

 - 2nd condition - IF the Mat% column is blank but the Type No is not MN then the result is 0

- 3rd condition -  IF the Mat% is not blank then multiply Mat% to Hrs = Result

AllanBerces_0-1758008212493.png

RESULT

AllanBerces_1-1758008244085.png

HrsType NoMat %RESULT
12I0112
2MN 2
51FR 0
40I0 0
5.5MN 5.5
1.6MN 1.6
1.6MN 1.6
1.85M1211.85
9.54M200
8.85I0 0
2.71MN 2.71
0.1M1210.1
0WD 0
42.1MN 42.1
235.21I0 0
67.32M2167.32
6.69MN 6.69
66.42M200
65.46M200
17.45M20.6411.168
25.28M20.51913.12
42.99M200
51.66MN 51.66
14.95M200
14.95MN 14.95
12.69MN 12.69
9.01M200
13.59M200
14.75M200
1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Thankyou, @Cookistador, for your response.

Hi AllanBerces,

We appreciate your inquiry on the Microsoft Fabric Community Forum.

Based on my understanding of the issue, please find attached a screenshot and a sample PBIX file that may help resolve the problem:

vpnarojumsft_0-1758023982522.png
We hope the information provided is helpful. If you have any further questions, please feel free to contact the Microsoft Fabric community.

Thank you.




View solution in original post

5 REPLIES 5
v-pnaroju-msft
Community Support
Community Support

Thankyou, @Cookistador, for your response.

Hi AllanBerces,

We appreciate your inquiry on the Microsoft Fabric Community Forum.

Based on my understanding of the issue, please find attached a screenshot and a sample PBIX file that may help resolve the problem:

vpnarojumsft_0-1758023982522.png
We hope the information provided is helpful. If you have any further questions, please feel free to contact the Microsoft Fabric community.

Thank you.




Hi @v-pnaroju-msft @Cookistador thank you very much for the reply, working as i need.

Cookistador
Super User
Super User

Hi @AllanBerces 

 

The following PQ should return the desired result as a new custom column

 

if [Type No] = "MN" then [Hrs] else if [Mat%] = null then 0 else [Mat%] * [Hrs]

Hi @Cookistador thank you for the reply but it not giving the rigth value especially to 2nd condition, it show 0 to all MN should be the value of hrs column

I made a test, with the dataset you shared, and I got the following result (I just lost the decimal when I pasted it)

Cookistador_0-1758012032556.png

 

Can you show me the result of your column? Did you just copy and paste the code I provided ?

 

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.