Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
biancaramalho31
Regular 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.

 

biancaramalho31_0-1644964455125.png

 

Mas só funciona quando coloco o mes

 

biancaramalho31_0-1645031258879.png

 

Alguem sabe me dizer se é possivel ter essa visão sem usar data na matriz?

 

1 REPLY 1
v-rzhou-msft
Community Support
Community Support

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.

1.png

You see we get YTD in 2022 in matrix.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.