Forum Discussion
biancaramalho31
4 years agoRegular Visitor
Calcular YTD Usando Texto na Matrix
Gostaria de saber se é possivel mostrar o YTD quando o primeiro campo da Matriz é texto.
Preciso que seja calculado de acordo com o mes atual e com a linha.
Mas só funciona quando coloco o mes
Alguem sabe me dizer se é possivel ter essa visão sem usar data na matriz?
1 Reply
- AnonymousNot applicable
Hi biancaramalho31 ,
Do you want to calculate current YTD sum by group? Here I suggest you to create a "DimDate" table, then create a measure to achieve your goal.
Calendar = ADDCOLUMNS( CALENDARAUTO(),"Year",YEAR([Date]))Build a relationship between "DimDate"[Date] and "Data"[Date].
Measure:
YTD = CALCULATE(SUM('Table'[Value]),FILTER('Calendar','Calendar'[Year] = YEAR(TODAY())))Result is as below.
You see we get YTD in 2022 in matrix.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.