cancel
Showing results for
Did you mean: Frequent Visitor

## I need to bring the value of "Total Dotación" of the previous month

Hi,

I need to bring the value of "Total Dotación" of his respective "Rol" and "UN" in a different column.

example:

if the date of "Fecha"Marzo de 2019, "UN" EIIC and "Rol" ROL GENERAL is 333, I need in a different column the value of Febrero de 2019, 285. I would greatly appreciate your help.

1 ACCEPTED SOLUTION  Community Support

Hi @treeclauses ,

Yes, we can sum a column and a measure. You could try like this:

``````Measure 2 =
VAR total =
SUMX ( 'Table', 'Table'[Total Dotación] + [Measure] )
RETURN
DIVIDE ( total, 2 )
``````

If you don't want to do a calculation while the measure is blank, you could try this:

``````Measure 3 =
VAR total =
SUMX ( 'Table', 'Table'[Total Dotación] + [Measure] )
RETURN
IF ( ISBLANK ( [Measure] ), BLANK (), DIVIDE ( total, 2 ) )
`````` Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3  Community Support

Hi @treeclauses ,

• Create a calendar table
``Date = CALENDAR(MIN('Table'[Fecha]),MAX('Table'[Fecha]))``
•  Create a measure
``Measure = CALCULATE(SUM('Table'[Total Dotación]),DATEADD('Date'[Date],-1,MONTH))`` And there are many different ways to implement it. You also could reference the videos  to have a try.

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Frequent Visitor

it works! thanks! @v-xuding-msft

now, if i wanna sum the two values, and divide on 2, how can i do it? can i sum a column with a measure?  Community Support

Hi @treeclauses ,

Yes, we can sum a column and a measure. You could try like this:

``````Measure 2 =
VAR total =
SUMX ( 'Table', 'Table'[Total Dotación] + [Measure] )
RETURN
DIVIDE ( total, 2 )
``````

If you don't want to do a calculation while the measure is blank, you could try this:

``````Measure 3 =
VAR total =
SUMX ( 'Table', 'Table'[Total Dotación] + [Measure] )
RETURN
IF ( ISBLANK ( [Measure] ), BLANK (), DIVIDE ( total, 2 ) )
`````` Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.  