Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago

How to return multiple measures

9 Replies

  • lattys's avatar
    lattys
    Frequent Visitor

    I don't know if this helps but I wouldn't use switch here or at least try to swap them like STATION = SWITCH(B300_Ball[PHO]," "Tx1 ","Tx2"," ADMTR:1:1 ","Tx3"," ADMTR:1 ","Tx4"," ADMTR:2","Tx5"," ADMTR:2", B300_Ball[PHO]) (and I don't think this is what you are looking for) or use something like lookupvalue or even IF.  In my opinion the switch() function just "writes" Tx1 instead of ADMTR:1 and Tx4 instead of ADMTR:2. And if you don't have any other data next to those it isn't going to be easy, I think.

     

    But I'm just a beginner in PBI and DAX. I would be really happy if this could help you even a little.

     

    Here are some webpages that might help you:

    https://community.powerbi.com/t5/Desktop/Dax-to-lookup-from-multiple-values/td-p/177451

    https://powerpivotpro.com/2014/01/containsx-finding-if-a-value-in-table-1-has-a-matching-value-in-table-2/

    • Anonymous's avatar
      Anonymous
      Not applicable

      I've tried options and none working.. I'm still learning  and cant use  the 'if', lookupvalue or make any understanding of the links provided.

      Please I'd need this help

      • lattys's avatar
        lattys
        Frequent Visitor

        How do you link the AMDR and Tx values? Are they in the same table? Are the "Tx" things  values or measures?

        You could try : 

        your_measure = IF(Values(B300_Ball[PHO])=" ADMTR:1"; AND("Tx1"; "Tx3";"Tx4"); IF(Values(B300_Ball[PHO])=" ADMTR:2"; AND("Tx3; Tx5"))

        but maybe with "," instead of ";" (I have to use the semicolon so it just a habit of mine)