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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DateDiff

Bom dia a comunidade...

Preciso de ajuda quanto ao relatório que estraí utilizando o comando DateDiff.

O que devo fazer para somar os total dos dias por área ?

Ccoliveira1_0-1635431480645.png

Não entendo o resultado negativo em -83 dias.

Formula utilizada.

DIAS PARADOS =
IF(ISBLANK(Max(SUSE[Data/Hora Conclusão da atividade])),
DATEDIFF(Max(SUSE[Data/Hora Início da atividade]),TODAY(),DAY),
DATEDIFF(MAX(SUSE[Data/Hora Início da atividade]), MAX(SUSE[Data/Hora Conclusão da atividade]),DAY))
 
Agradeço a ajuda.

 

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

 

When a Measure is used on rows in a table, the column total for those rows is not calculated as a sum of the results in the rows, but instead it calculates using the same Measure formula and applies it to the total of the data selected. Due to this feature, the total value may be unexpected. In such case, you may do further calculation and correct the total value. Please try the Measure below and use it to create your visual instead of using DIAS PARADOS.

 

Correct_total = SUMX (

    SUMMARIZE(SUSE,SUSE[Data/Hora Conclusão da atividade]),

    SUSE[DIAS PARADOS]

)

 

Then, the result will look like this:

vcazhengmsft_0-1635729520054.png

 

Best Regards,

Community Support Team _ Caiyun

 

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

View solution in original post

2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

 

When a Measure is used on rows in a table, the column total for those rows is not calculated as a sum of the results in the rows, but instead it calculates using the same Measure formula and applies it to the total of the data selected. Due to this feature, the total value may be unexpected. In such case, you may do further calculation and correct the total value. Please try the Measure below and use it to create your visual instead of using DIAS PARADOS.

 

Correct_total = SUMX (

    SUMMARIZE(SUSE,SUSE[Data/Hora Conclusão da atividade]),

    SUSE[DIAS PARADOS]

)

 

Then, the result will look like this:

vcazhengmsft_0-1635729520054.png

 

Best Regards,

Community Support Team _ Caiyun

 

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

lbendlin
Super User
Super User

What is your expected result? Think like the Grand Total. Very often measures designed for the Grand Total will also work for the Row and Column Totals and for the individual cells.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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