Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX Help - Define Variable Using Two Tables

Community, I currently have three tables. I would like to use two of the tables to define a variable, then apply the variable along with values in the third table to calculate a value. Below are th...
  • v-gizhi-msft's avatar
    6 years ago

    Hi,

     

    Please unpivot table ATD and table PassID first:

    Table ATD:                                                         Table PassID:

       

    Then try this measure:

    Measure = 
    var SameID = CALCULATE(MAX(ATD[Pass ID]),FILTER(ATD,ATD[Attitude ID]=ATD[Pass ID]))
    var Attribute = CALCULATE(MAX(PassID[Attribute]),FILTER(PassID,PassID[Pass ID]=SameID&&PassID[Value]=100))
    var variable = CALCULATE(MAX(ATD[Value]),FILTER(ATD,ATD[Attitude ID]=ATD[Pass ID]&&ATD[Attribute]=Attribute))
    return
    MAX(Slope[CL_x^2])*variable*variable-MAX(Slope[CL_x])*variable+MAX(Slope[CL_icpt])

    Choose a card visual, the result shows:

    Here is my test pbix file:

    pbix 

    Hope this helps.

     

    Best Regards,

    Giotto Zhi