Forum Discussion

AleVogel's avatar
AleVogel
New Member
3 years ago
Solved

get wrong total in table with measure

HI,

I have two tables, one has week number and initial forecast, second table has week number and actual sales, I want combine with a measure "Actual Forecast" where measure take "actual sale" for past weeks and "first forecast" for future weeks I do the next measure

ACTUAL FORECAST =
VAR lastWeekActualSale = MAX('ActualSales'[WEEK])
VAR lastWeekForecast = MAX('FirstForecast'[WEEK]
RETURN
IF(lastWeekForecast > lastWeekActualSale ,SUM('FirstForecast'[firstForecast]),SUM(ActualSales]))

 

But I have an error in Total of Actual Forecast, should be 520.040.000 

 

How can I fix it?

 

Thanxs a Lot

 

  • Hi,

    I am not sure how your datamodel looks like, but please try to write one more measure something like below and put it into your table visualization.

     

    Actual Forecast totalfix: =
    SUMX ( DISTINCT ( 'CalendarTable'[WEEK] ), [ACTUAL FORECAST] )
    

1 Reply

  • Hi,

    I am not sure how your datamodel looks like, but please try to write one more measure something like below and put it into your table visualization.

     

    Actual Forecast totalfix: =
    SUMX ( DISTINCT ( 'CalendarTable'[WEEK] ), [ACTUAL FORECAST] )