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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.