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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

create measure depend on other table muliple columns

Hi everyone,
I m new to DAX and struggling for the last 24 hours to create the measure based on another table but couldn't get it and found the message ( a table of multiple values was supplied where a single value was expected. My calculated column is working fine but I want to create a measure.

 

calculated column=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-1628575053348.png

thanks 

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous 

 

First, you have to describe clearly what you want to achieve. Second, measures are not calculated columns. They work in a totally different way and serve a different purpose. There's no direct translation of a calculated column into a measure. So, to get a good answer you have to do the above and I would also whole-heartedly recommend reading this: How to Get Your Question Answered Quickly - Microsoft Power BI Community

 

Then, after following all the advice, you may stand a good chance to get a good answer.

Anonymous
Not applicable

that is why I need help to create a measure

Anonymous
Not applicable

Using CALCULATE in calculated columns is one VERY BAD idea because you are invoking context transition on each and every row. This has many consequences. One of them being slow code.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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