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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Mjwhite1
Frequent Visitor

Help on a query. I have an error but I am not sure where. I need to filter on different columns

if [BUSINESS TYPE] <> "New Product" or [BUSINESS TYPE] <> "Distributed Capacity" then 0 else

 

if [BUSINESS TYPE] = "New Product" or [BUSINESS TYPE] = "Distributed Capacity" then

 

if [NO OF MONTHS] < 24 then 0 else

if [NO OF MONTHS] >= 24 and [NO OF MONTHS] <= 36 then
(( [NO OF MONTHS] - 12) / 12) * (.50 * [Tier 1 Rate]) * [FINAL COMMISSIONABLE VALUE USD] else

 

if [NO OF MONTHS] >= 36 then
((36 - 12) / 12) * (.50 * [Tier 1 Rate]) * [FINAL COMMISSIONABLE VALUE USD] else

 

0

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Mjwhite1,

 

 

Based on my assumption, you may want a if condition like below:

if [BUSINESS TYPE]<>"New Product" and [BUSINESS TYPE]<> "Distributed Capacity"
then 0

else if [NO OF MONTHS]<24

then 0

else if [NO OF MONTHS]>=24 and [NO OF MONTHS]<=36
then (( [NO OF MONTHS] - 12) / 12) * (.50 * [Tier 1 Rate]) * [FINAL COMMISSIONABLE VALUE USD]
else ((36 - 12) / 12) * (.50 * [Tier 1 Rate]) * [FINAL COMMISSIONABLE VALUE USD]

 

Best regards,

Yuliana Gu

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

4 REPLIES 4
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Mjwhite1,

 

 

Based on my assumption, you may want a if condition like below:

if [BUSINESS TYPE]<>"New Product" and [BUSINESS TYPE]<> "Distributed Capacity"
then 0

else if [NO OF MONTHS]<24

then 0

else if [NO OF MONTHS]>=24 and [NO OF MONTHS]<=36
then (( [NO OF MONTHS] - 12) / 12) * (.50 * [Tier 1 Rate]) * [FINAL COMMISSIONABLE VALUE USD]
else ((36 - 12) / 12) * (.50 * [Tier 1 Rate]) * [FINAL COMMISSIONABLE VALUE USD]

 

Best regards,

Yuliana Gu

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

Thank you that worked perfectly! Appreciate the help.

jthomson
Solution Sage
Solution Sage

What error are you actually getting?

 

It'd be much easier to read if you didn't have so much redundant code - it can easily look something like this (clearly needing to get brackets correct):

 

cleaner if statement.PNG

if [BUSINESS TYPE] <> "New Product" or [BUSINESS TYPE] <> "Distributed Capacity" then 0 else

 

if [NO OF MONTHS] < 24 then 0 else

 

[NO OF MONTHS] <= 36 then

 

(( [NO OF MONTHS] - 12) / 12) * (.50 * [Tier 1 Rate]) * [FINAL COMMISSIONABLE VALUE USD] else

((36 - 12) / 12) * (.50 * [Tier 1 Rate]) * [FINAL COMMISSIONABLE VALUE USD] else

 

0

 

I have an EOF error on the : then after the 36. I am new to power BI i have worked with it for a few weeks. It is dealing with two seperate columns. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.