Forum Discussion
Need help with Power BI matrix visual
- Anonymous2 years ago
Hi malpani ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create measures.
Title = var _a=CALCULATE(MAX('Table'[Child-Title]),FILTER(ALLSELECTED('Table'),'Table'[Child-Key]=MAX('Table'[Child-Key]))) return SWITCH(TRUE(), ISINSCOPE('Table'[Child-Key]),_a, ISINSCOPE('Table'[Parent-Key]),MAX('Table'[Parent-Title]),BLANK())Status = var _a=CALCULATE(MAX('Table'[Child-Status]),FILTER(ALLSELECTED('Table'),'Table'[Child-Key]=MAX('Table'[Child-Key]))) return SWITCH(TRUE(), ISINSCOPE('Table'[Child-Key]),_a, ISINSCOPE('Table'[Parent-Key]),MAX('Table'[Parent-status]),BLANK())(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi malpani ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create measures.
Title =
var _a=CALCULATE(MAX('Table'[Child-Title]),FILTER(ALLSELECTED('Table'),'Table'[Child-Key]=MAX('Table'[Child-Key])))
return SWITCH(TRUE(),
ISINSCOPE('Table'[Child-Key]),_a,
ISINSCOPE('Table'[Parent-Key]),MAX('Table'[Parent-Title]),BLANK())Status =
var _a=CALCULATE(MAX('Table'[Child-Status]),FILTER(ALLSELECTED('Table'),'Table'[Child-Key]=MAX('Table'[Child-Key])))
return SWITCH(TRUE(),
ISINSCOPE('Table'[Child-Key]),_a,
ISINSCOPE('Table'[Parent-Key]),MAX('Table'[Parent-status]),BLANK())
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- malpani2 years ago
Helper II
Anonymous
Thank you so much for your support.
I have one more question -
There are more columns in dataset but those are applicable to only Parent and not to Child e.g. 'Parent_Origin'. So, those should be visible only for Parent Key and not for Child Key.
I achieved this by adding one blank column for 'Child_Origin'. in Power query and then created similar Measure for Origin as well.
Is it possible to do this without having a blank column ?- Anonymous2 years agoNot applicable
Hi malpani ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
Origin = SWITCH(TRUE(), ISINSCOPE('Table'[Child-Key]),BLANK(), ISINSCOPE('Table'[Parent-Key]),MAX('Table'[Parent_Origin]),BLANK())(3) Then the result is as follows.
Best Regards,
Neeko Tang