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
venildo_amaral
New Member

Problem with DatesYTD - It does not accumulate when a field has no value

Turnover Qtd Demitidos Ate Mes =
var Retorno = CALCULATE
    (
        count(fatoAtivo[id]),
        fatoAtivo[TipoDado]=2,
        fatoAtivo[Demitido]=True,
        DATESYTD(calendario[Data])
    )
return if(ISBLANK(retorno),0,Retorno)


I made the measurement above, with the aim of accumulating the number of records from the beginning of the year to the selected month, if I put it on a card it works normally, it brings the total correctly, however if I put it in a matrix opened by the "CargoPiramide" field , and in a given month there is no value for this field, the accumulation for that month is not performed.
For example, in the month of Jan'2023 there were 3 directors dismissed, in the month of Feb'2023 none, when I select the month of Feb'2023, the value of the director in the matrix is zeroed, and the right thing to do was to come 3, which is the amount that it had in the previous month, but the current month, as the current month has no value, so the result should be 3, when information appears on the following month, the sum is correct, the problem is only when a month does not give you information, so that month does not appear the accumulated until it, it is simply zeroed.
How to resolve this to measure?

3 REPLIES 3
Mahesh0016
Super User
Super User

@venildo_amaral please Share Your Expected output in matrix.

As you can see on screen 1, when the month of Jan'2023 is selected, 2 records appear in the dismissed for director, when the month of Feb'2023 is selected, the director is reset, the 2 should come here, as it is accumulated from Jan'2023.
Thanks

Tela 1 - Jan.PNGTela 2 - Fev.PNG

Adding to the previous answer, I realized that the problem is opening the columns by Dismissed and Admitted, I put the same measure inside a table and the result is correct, but when it is inside the matrix, it gives the error mentioned above.

In the image below you can see that when it is a table, the director's record appears with 2

Tela 3 - Tab.PNG

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.

Top Solution Authors