Forum Discussion
Copy text from within table
- Anonymous3 years ago
Hi deisterBI ,
If you want to add a new column, you also just need to adjust my measure simply, please try below dax formula:
Article Column = VAR cur_monarticle = 'Table'[Mother article] VAR tmp = FILTER ( ALL ( 'Table' ), 'Table'[Mother article] = cur_monarticle ) VAR max_sale = MAXX ( tmp, [Sales] ) VAR article = CALCULATE ( MAX ( 'Table'[Doughter article] ), FILTER ( ALL ( 'Table' ), 'Table'[Sales] = max_sale ) ) RETURN articlePlease refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi deisterBI ,
Please try below steps:
1. below is my test table
Table:
2. create measure with below dax formula
Main Article =
VAR max_sale =
MAXX ( ALL ( 'Table' ), [Sales] )
VAR article =
CALCULATE (
MAX ( 'Table'[Doughter article] ),
FILTER ( ALL ( 'Table' ), 'Table'[Sales] = max_sale )
)
RETURN
article
3. add a table visual with fields and measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
just to make this more transparant, with more than one mother article:
the collum main article would again be my desired outcome.
| mother article | Doughter article | sales | main article |
| car | door | 2 | tires |
| car | tires | 4 | tires |
| car | wheel | 2 | tires |
| truck | door | 2 | windshield |
| truck | tires | 4 | windshield |
| truck | wheel | 2 | windshield |
| truck | windshield | 6 | windshield |
- Anonymous3 years agoNot applicable
Hi deisterBI ,
You just need to adjust my measure simply, please try below dax formula:
Main Article = VAR cur_monarticle = SELECTEDVALUE ( 'Table'[Mother article] ) VAR tmp = FILTER ( ALL ( 'Table' ), 'Table'[Mother article] = cur_monarticle ) VAR max_sale = MAXX ( tmp, [Sales] ) VAR article = CALCULATE ( MAX ( 'Table'[Doughter article] ), FILTER ( ALL ( 'Table' ), 'Table'[Sales] = max_sale ) ) RETURN articlePlease refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- deisterBI3 years agoFrequent Visitor
amazing.
and if I wanted to have that same result, as a collum in the table itself not as a messure ?
I would need to have that field in order to link it in the datamodell with another table.- Anonymous3 years agoNot applicable
Hi deisterBI ,
If you want to add a new column, you also just need to adjust my measure simply, please try below dax formula:
Article Column = VAR cur_monarticle = 'Table'[Mother article] VAR tmp = FILTER ( ALL ( 'Table' ), 'Table'[Mother article] = cur_monarticle ) VAR max_sale = MAXX ( tmp, [Sales] ) VAR article = CALCULATE ( MAX ( 'Table'[Doughter article] ), FILTER ( ALL ( 'Table' ), 'Table'[Sales] = max_sale ) ) RETURN articlePlease refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.