Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

VAR Filter

Hello,

 

I ve written dax

 

Touch up Yield =
VAR
    Touchup = FILTER(TJob, TJob[SekundærNavn] = "Touch up" )
Return
    DIVIDE(SUMX(TJob, TJob[FirstPassQty]), SUMX(TJob, TJob[Antal]))
 
Now i m stuck cause i dont know how to link SekundærNavn filter id to my formula. that divide function would take only "Touch up" category into consideration
  • Touch up Yield =CALCULATE(DIVIDE(SUM(TJob[FirstPassQty]),SUM(TJob[Antal])),TJob[SekundærNavn] = "Touch up")
  • Hi,

    I am not sure if I understood your question correctly, but please try the below whether it suits your requirement.

     

    Touch up Yield =
    VAR Touchup =
        FILTER ( TJob, TJob[SekundærNavn] = "Touch up" )
    RETURN
        DIVIDE ( SUMX ( Touchup, TJob[FirstPassQty] ), SUMX ( Touchup, TJob[Antal] ) )
    

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Both solution are working great!

     

    Thank you both of you for quick answer

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Community Champion
    Touch up Yield =CALCULATE(DIVIDE(SUM(TJob[FirstPassQty]),SUM(TJob[Antal])),TJob[SekundærNavn] = "Touch up")
  • Hi,

    I am not sure if I understood your question correctly, but please try the below whether it suits your requirement.

     

    Touch up Yield =
    VAR Touchup =
        FILTER ( TJob, TJob[SekundærNavn] = "Touch up" )
    RETURN
        DIVIDE ( SUMX ( Touchup, TJob[FirstPassQty] ), SUMX ( Touchup, TJob[Antal] ) )