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

View all the Fabric Data Days sessions on demand. View schedule

Reply
aiplbonn
Regular Visitor

Restrictions to LOOKUPVALUE

Hi,

 

to calculate the tax (mwst) in an order table, i have created a tax (mwst) table with the matching country code.

 

MWST = LOOKUPVALUE(Mwst[VAT Regular],MWST[land],OrderData[land],1)
 

But now I need another restriction.

If the field class in the table OrderData contains the word "special", the field "VAT Special" should be used in the VAT table instead of the field VAT Regular.
If the field class contains something other than "special", then simply "VAT Regular".

In Speudo code like this.

 

if(OrderData[class]= special)

         LOOKUPVALUE(Mwst[VAT Special],MWST[land],OrderData[land],1)

else

        LOOKUPVALUE(Mwst[VAT Regular],MWST[land],OrderData[land],1)

 

But i have no idea how to do this the rigth way.

 

2 ACCEPTED SOLUTIONS
FreemanZ
Super User
Super User

hi @aiplbonn 

 

try like:

MWST  =
VAR _special =        
LOOKUPVALUE(
     Mwst[VAT Special],
     MWST[land],
     OrderData[land],
    1 
)
VAR _regular = 
LOOKUPVALUE(
    Mwst[VAT Regular],
    MWST[land],
    OrderData[land],
    1
)
RETURN 
IF(
    CONTAINSSTRING(OrderData[class], "special"),
    _special, _regular
) 

View solution in original post

aiplbonn
Regular Visitor

hi @FreemanZ 

 

this works perfectly! Thank you so much!

View solution in original post

2 REPLIES 2
aiplbonn
Regular Visitor

hi @FreemanZ 

 

this works perfectly! Thank you so much!

FreemanZ
Super User
Super User

hi @aiplbonn 

 

try like:

MWST  =
VAR _special =        
LOOKUPVALUE(
     Mwst[VAT Special],
     MWST[land],
     OrderData[land],
    1 
)
VAR _regular = 
LOOKUPVALUE(
    Mwst[VAT Regular],
    MWST[land],
    OrderData[land],
    1
)
RETURN 
IF(
    CONTAINSSTRING(OrderData[class], "special"),
    _special, _regular
) 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.