Forum Discussion

D3K's avatar
D3K
Advocate II
7 years ago

Measure which returns distinct values

Hello everyone!

 

Please, help to find the solution and even is it possible to create?

 

I have a few tables: managers, clients (name and type), sales (with region and city of client's branch).

 

I've created the table with list of client's attributes:

Manager

Client

Region

City

Type

 

And I want to create next switcher for implementing it into visualization with Sales, Profit and so on:

 

Switcher Client Attribute =
SWITCH(TRUE();
SELECTEDVALUE('Clients Attribute'[Attribute])="Manager"; xxxxxxxx;
SELECTEDVALUE('Clients Attribute'[Attribute])="Client"; xxxxxxxx;
SELECTEDVALUE('Clients Attribute'[Attribute])="Region"; xxxxxxxx;
SELECTEDVALUE('Clients Attribute'[Attribute])="City"; xxxxxxxx;
SELECTEDVALUE('Clients Attribute'[Attribute])="Type"; xxxxxxxx;
BLANK())
 
What do I need to use instead of "xxxxxxxx" to get a list of distinct values from different tables related on selected switcher value?
 
Any help will be appreciated
 
Thanks a lot!

2 Replies

  • sturlaws's avatar
    sturlaws
    Resident Rockstar

    Hi,

     

    I don't think it is possible to do what you intend to do.

     

    Measures, like your Switcher Client Attribute, cannot return lists unless there is a context. If you have a table with say ClientID and Switcher Client Attribute, it would give the attribute pr ClientID. But having Switcher Client Attribute in a table by itself will only give you one value.

     

    regards,

    Sturla

    • D3K's avatar
      D3K
      Advocate II

      sturlaws


       


      But having Switcher Client Attribute in a table by itself will only give you one value.

       

      Exactly what I've faced to. Thank you for your answer