SELECTEDVALUE et liste concaténée

Accueil – Le CFO masqué Forums Power BI SELECTEDVALUE et liste concaténée

  • Ce sujet contient 1 réponse, 2 participants et a été mis à jour pour la dernière fois par Xavier Allart, le il y a 10 mois.
2 sujets de 1 à 2 (sur un total de 2)
  • Auteur
    Messages
  • #138925
    benjamin.janiaud
    Participant

    Bonjour,

    Je rencontre un point bloquant que je n’arrive pas à résoudre.
    Je souhaite créer un titre dynamique.
    Lorsque rien n’est sélectionné, rien ne doit apparaître
    Lorsque je sélectionne une ou plusieurs filières, je dois trouver la liste concaténée.

    J’ai tenté cette formule DAX :
    selected_filière = SELECTEDVALUE(‘Index_filières'[Filière],VAR __DISTINCT_VALUES_COUNT = DISTINCTCOUNT(‘Index_filières'[Filière])
    VAR __MAX_VALUES_TO_SHOW = 5
    RETURN
    IF(
    __DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW,
    CONCATENATE(
    CONCATENATEX(
    TOPN(
    __MAX_VALUES_TO_SHOW,
    VALUES(‘Index_filières'[Filière]),
    ‘Index_filières'[Filière],
    ASC
    ),
    ‘Index_filières'[Filière],
    “, “,
    ‘Index_filières'[Filière],
    ASC
    ),
    “, etc.”
    ),
    CONCATENATEX(
    VALUES(‘Index_filières'[Filière]),
    ‘Index_filières'[Filière],
    “, “,
    ‘Index_filières'[Filière],
    ASC
    )
    ))

    #139868
    Xavier Allart
    Participant

    Bonjour

    Voici une piste
    selected_filière =
    Var _Total = COUNTROWS(ALL(‘Index_filières’))
    Var _Count = COUNTROWS(VALUES(‘Index_filières'[Filière]))
    Var _MaxList = 5
    Var _List = CONCATENATEX(TOPN(_MaxList,VALUES(‘Index_filières'[Filière])),[Filière],”, “)
    Return
    IF (_Count=_Total,”Tout”,IF (_Count>_MaxList,_List&”, etc”, _List))

    Amicalement

2 sujets de 1 à 2 (sur un total de 2)
  • Vous devez être connecté pour répondre à ce sujet.