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
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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Solution Authors