SELECTEDVALUE et liste concaténée

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

  • This topic has 1 reply, 2 voices, and was last updated 1 year ago by Xavier Allart.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.