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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.