Forum Discussion
Power BI Dax Filtering Question - Selecting all current and lower index values
- 2 years ago
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]
)
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],
", "
)
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:
| Speaking | 1 |
| Speaking | 2 |
| Speaking | 3 |
| Listening | 1 |
| Listening | 2 |
i would appreciate any help!
- lbendlin2 years ago
Super User
Not possible. You must consume the virtual table inside the measure. Measures can only return scalars.
- popman19872 years agoRegular Visitor
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]
)
- ArmandoFranco2 years agoFrequent Visitor
As others have said, a measure can not return a table.
That's why I used CONCATENATEX to get a single value.