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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Create measure depend on another table

Hi

Good Morning everyone, everyone I m new to power bi so needs your help to create the measure. I'm trying it for the last 24 hours but couldn't get it right. please help me. I have tried the below-mentioned measure but it shows error ( a table of multiple values was supplied where single value was expecting)
 

Calculated Column Tariff = CALCULATE(LASTNONBLANK(Tariff_ExpTHC1[Tariff],1),FILTER(Tariff_ExpTHC1,'Document Line'[Size2]=Tariff_ExpTHC1[Size]&&'Document Line'[Activity No_]=Tariff_ExpTHC1[No.]&&'Document Line'[Gross Weight]>=Tariff_ExpTHC1[From_Wt]&&'Document Line'[Gross Weight]<=Tariff_ExpTHC1[To_Wt]&&'Document Line'[LEO Date]>=Tariff_ExpTHC1[From_Date]&&'Document Line'[LEO Date]<=Tariff_ExpTHC1[To_Date]) )

 

Tariff_Ex_Document_Line( measure) = CALCULATE(

    MAXX(Tariff_ExpTHC1,Tariff_ExpTHC1[Tariff]),

    TREATAS(

        SUMMARIZE('Document Line’, ‘Document Line'[Activity No_],

        'Document Line'[Size2]),

        Tariff_ExpTHC1[No.],

        Tariff_ExpTHC1[Size]

    ),

    FILTER(

        Tariff_ExpTHC1,

        VALUES('Document Line'[Gross Weight])>=Tariff_ExpTHC1[From_Wt]

        && VALUES('Document Line'[Gross Weight])<=Tariff_ExpTHC1[To_Wt]

        && VALUES('Document Line'[LEO Date])>=Tariff_ExpTHC1[From_Date]

        && VALUES('Document Line'[LEO Date])<=Tariff_ExpTHC1[To_Date]

        )

        )

 

Among_Us_0-1628573837853.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

To my knowledge, I think the below syntax is incorect.

DAX error.PNG

You may try to use the following formula to modify it :

   FILTER(

        Tariff_ExpTHC1,

       'Document Line'[Gross Weight]>=MAX(Tariff_ExpTHC1[From_Wt])

        && 'Document Line'[Gross Weight]<=MAX(Tariff_ExpTHC1[To_Wt])

        && 'Document Line'[LEO Date]>=MAX(Tariff_ExpTHC1[From_Date])

        && 'Document Line'[LEO Date]<=MAX(Tariff_ExpTHC1[To_Date])

        )


Best Regards,
Eyelyn Qin
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

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

To my knowledge, I think the below syntax is incorect.

DAX error.PNG

You may try to use the following formula to modify it :

   FILTER(

        Tariff_ExpTHC1,

       'Document Line'[Gross Weight]>=MAX(Tariff_ExpTHC1[From_Wt])

        && 'Document Line'[Gross Weight]<=MAX(Tariff_ExpTHC1[To_Wt])

        && 'Document Line'[LEO Date]>=MAX(Tariff_ExpTHC1[From_Date])

        && 'Document Line'[LEO Date]<=MAX(Tariff_ExpTHC1[To_Date])

        )


Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.