Forum Discussion

popman1987's avatar
popman1987
Regular Visitor
2 years ago
Solved

Power BI Dax Filtering Question - Selecting all current and lower index values

Could someone please help me solve the below issue?

i have the below table called "Skill Selection List":

Skill Level
Writing1
Writing2
Writing3
Writing4
Reading1
Reading2
Reading3
Reading4
Listening1
Listening2
Listening3
Listening4
Speaking1
Speaking2
Speaking3
Speaking4

i have created a slicer with the combination of the two columns from the "Skill Selection List" Table. i want to create a measure that returns a dynamic table , where if i select, for example, Speaking 3 and Listening 2, the measure will return a table of Speaking 1, 2, 3 and Listening 1, Listening 2

 

  • HI All,

    Apologies if my request was confusing!
    The measure i have requested a solution for is a variable in a larger measure, which eventually gets wrapped in COUNTROW

    If anyone cares, this is the solution i ended up going with

    VAR filtertable = 
    SELECTCOLUMNS( GENERATE 
    'Skills Selection List', 
    GENERATESERIES(1,''Skills Selection List',[Level],1))
    "Skill",[Skill},
    "Level",[Value]
    )





7 Replies

  • Measures can only return scalar values. Are you sure your UX design will not be confusing to users?

  • ArmandoFranco's avatar
    ArmandoFranco
    Frequent Visitor

    You could add a column with this formula.

     



    All Skills =
    VAR _Skill = 'Skill Selection List'[Skill]
    VAR _Level = 'Skill Selection List'[Level]
    RETURN
        CONCATENATEX (
            FILTER (
                ALL ( 'Skill Selection List' ),
                AND (
                    'Skill Selection List'[Skill] = _Skill,
                    'Skill Selection List'[Level] <= _Level
                )
            ),
            'Skill Selection List'[Skill] & " " & 'Skill Selection List'[Level],
            ", "
        )

     

    • popman1987's avatar
      popman1987
      Regular Visitor

      Thank you for the reply!
      I was hoping to get something similar to this but in a measure form, and the results to be something like this, as i wanted to later on use this virtual table in a UNION measure:

      Speaking1
      Speaking2
      Speaking3
      Listening1
      Listening2


      i would appreciate any help!

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        Not possible. You must consume the virtual table inside the measure. Measures can only return scalars.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi popman1987 

     

    Many thanks to lbendlin  and ArmandoFranco  for their prompt reply.

     

    Can you tell me if your problem is solved? If yes, please accept it as solution!

     

    Regards,

    Nono Chen