Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Allselected function

Hallo Everyone,

 

I want to have a measure that uses all selcect on two different tables to include their Slicer in the Report .

 

Could someone please  correct the measure bellow?

Event_Duration_MIN average per Event_Start_Date =
AVERAGEX((

ALLSELECTED('SL F_Events'[Event_Start_Date],'SL D_Plant'[Name])),[Sum event duration])
  • Hi Anonymous ,

     

    All column arguments of the ALL/ALLNOBLANKROW/ALLSELECTED function must be from the same table.

    Try to create a relationship between the two tables and use the relationship column as the parameter of the ALLSELECTED () function.

     

    Best regards,
    Lionel Chen

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

5 Replies

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Anonymous ,

     

    All column arguments of the ALL/ALLNOBLANKROW/ALLSELECTED function must be from the same table.

    Try to create a relationship between the two tables and use the relationship column as the parameter of the ALLSELECTED () function.

     

    Best regards,
    Lionel Chen

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

  • AllisonKennedy's avatar
    AllisonKennedy
    Community Champion

    Not sure if I understand exactly what you mean, but would this work? 

    Event_Duration_MIN average per Event_Start_Date =
    AVERAGEX(
    FILTER(ALLSELECTED('SL F_Events'[Event_Start_Date]),ALLSELECTED('SL D_Plant'[Name])),[Sum event duration])
     
    You will need to have the correct relationships defined for it to work, so if this doesn't help, please post details of your data model and relationships along with clarification of what you need. 
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for your reply. I have added your measure, but I am not getting any value, like below. 

       

      The Plant name is in the dimention table and it has a direct relationship to the table with the date. 

       

      SL D_Plant and SL F_Events have a relationship

      • v-lionel-msft's avatar
        v-lionel-msft
        Community Support

        Hi Anonymous ,

         

        Has your problem been solved? If yes please consider Accept it as the solution to help the other members find it more quickly.

         

        Best regards,
        Lionel Chen