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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.