Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago

Measure Total not as expected

Hi All,

 

I have seen a couple of solutions on this topic but they haven't "Fixed" the issue for me.

I have a measure that is as follow:

Trading_FEE_Measure =
VAR battery_site = SELECTEDVALUE(R_BATTERY_SITES[SITE_ID])
VAR Period  = SELECTEDVALUE(DateTime_Calendar[Date])
VAR Cashflow_Calc = -0.05 * [Total cashflow before Fees_TNUoS_CM_Total]
RETURN
IF(battery_site = 1,
    IF(Period >=[Cowley Fee change date],
    [COWL_POST_DATE_TRADE_FEE],[COWL_PRE_DATE_TRADE_FEE]),
IF(battery_site = 2,
    IF( Period <= [Kemsley Fee change date],Cashflow_Calc,[KEML_POST_DATE_FEE]),
IF(battery_site in {3,4}, Cashflow_Calc)))

This is used in a monthly and YTD kpi summary. 
When I look at the individual values per day the figures are correct, by when I aggregate to either month or year they do not return the expected values.

I've tried using SUMX(VALUES(....  but that hasn't changed the total.

I've attached data also.
DateTrading_FEE_Measure&
01/01/2024 00:00-221.2832
02/01/2024 00:00-110.488
03/01/2024 00:00-125.3112
04/01/2024 00:00-91.606
05/01/2024 00:00-66.7328
06/01/2024 00:00-116.8532
07/01/2024 00:00-91.3908
08/01/2024 00:00-125.6324
09/01/2024 00:00-97.3376
10/01/2024 00:00-155.0964
11/01/2024 00:00-81.9108
12/01/2024 00:00-107.5072
13/01/2024 00:00-73.2616
14/01/2024 00:00-66.5768
15/01/2024 00:00-143.0968
16/01/2024 00:00-152.5268
17/01/2024 00:00-159.906
18/01/2024 00:00-162.5812
19/01/2024 00:00-88.2152
20/01/2024 00:00-84.9988
21/01/2024 00:00-99.6264
22/01/2024 00:00-146.3456
23/01/2024 00:00-141.1916
24/01/2024 00:00-162.4156
25/01/2024 00:00-103.9584
26/01/2024 00:00-105.6484
27/01/2024 00:00-126.1364
28/01/2024 00:00-145.3
29/01/2024 00:00-148.0212
30/01/2024 00:00-69.9268
31/01/2024 00:00-111.4830981



4 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    what sumx dax code did you try you haven't put it in full here.  please can you provide a sample of the underlying data and then what you expect that data to say in the the summed visual.

     

    also can

  • Hello, Anonymous ,
    given your sample data + I created Calendar;
    trading_sum is just your data (in your case would be prolly the measure you use),

    mtd = TOTALMTD([trading_sum], 'calendar'[Date])

     

    ytd = TOTALYTD([trading_sum], 'calendar'[Date])
  • Hi,

    Explain the question is simple English and show the expected result very clearly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    Has your problem been resolved? If so, could you share your solution so that others with similar issues can benefit from it? If not, please provide sample data that fully covers your issue and the expected outcome based on the sample data you provided.

     

     

     

     

     

    Best Regards,

    Jayleny

     

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