Forum Discussion
Anonymous
6 years agoNot applicable
Data modelling question
Hi, I have one specific requirement in Power BI that I am unable to figure out. I have an 'Employees' table in my data model which consists of the following columns and sample data, ...
- 6 years ago
Hey Anonymous ,
my table looks like this:
I use this DAX statement to create a calculated column:
reportsto name = var reportsto_id = 'Table'[reportsto] return CALCULATE( FIRSTNONBLANK('Table'[name] , 0) , FILTER( ALL('Table') , 'Table'[id] = reportsto_id ) )Now the table looks like this:
Hopefully this is what you are looking for.
Regards,
Tom
TomMartens
6 years agoSuper User
Hey Anonymous ,
my table looks like this:
I use this DAX statement to create a calculated column:
reportsto name =
var reportsto_id = 'Table'[reportsto]
return
CALCULATE(
FIRSTNONBLANK('Table'[name] , 0)
, FILTER(
ALL('Table')
, 'Table'[id] = reportsto_id
)
)
Now the table looks like this:
Hopefully this is what you are looking for.
Regards,
Tom
Anonymous
6 years agoNot applicable
Hi Tom,
Thanks for your help, the formula is working 🙂.
I was just wondering why the formula is not working without defining a 'var' and using 'return'. Is it not possible to achieve the same resultset by using only CALCULATE or some other DAX function? Just curious.
Thanks,
Sourav