Forum Discussion
Cipriano
Helper III
4 years agoRecursive calculation in table using DAX
Good afternoon everyone, To request your support, I am starting in Power BI, and I need to perform the calculation of the column: consumptionCalculated, this value is calculated: 1.- When the...
- Anonymous4 years ago
Hi Cipriano ,
Please try this code to create a calcualted column.
consumoCalculado = VAR _Child = SUMMARIZE ( FILTER ( 'Table', 'Table'[nombre] <> EARLIER ( 'Table'[nombre] ) && CONTAINSSTRING ( 'Table'[nombre], EARLIER ( 'Table'[nombre] ) ) ), [nombre] ) VAR _SUMCHILD = CALCULATE ( SUM ( 'Table'[consumo] ), FILTER ( 'Table', 'Table'[nombre] IN _Child ) ) RETURN IF ( 'Table'[consumo] <> BLANK (), 'Table'[consumo], _SUMCHILD )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lbendlin
Super User
4 years agoWill you have situations in your data where PadreC does not have any child records?