Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Cumulative TOTALTYD measure adds wrong information

Hello Power BI community,

 

For this problem i need your help. In the matrix below i am trying to calculate the returns of investments. At firts i made a measure that calculates the returns called 'rendement'. But now the returns is empty on week 52 and because of that the cumulative goes from 683944 to 3131372 when it should stay the same, because the measure of the returns is 0. Can someone explain why this is happening?

2 Replies

  • Hey,

     

    please post the DAX behind the measures for [Rendement] and [**bleep**. Total Rendement], I assume both are measure and not calculated columns.

     

    Regards,

    Tom

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi TomMartens,

       

      Sorry for the late reply.

      Below I will first give you the measure of Rendement and after that the cumulative rendement. the measure rendement exists of 4 elements: turnover minus cost of labor minus cost of usage of gas minus the rent.

       

      Rendement = [Omzet]-[Totaal arbeid]-[Totale gaskosten]-sum('Kosten huur-gas-arbeid'[Huur per week])

       

      Omzet =
      ([Middenprijs komkommers]*CALCULATE(SUM(Productiegegevens[Productie teelt]);
          FILTER(Productiegegevens;Productiegegevens[Soort teelt]="Komkommer"))+
      (SUM('Prijs gegevens'[€/kg l'amuse])*CALCULATE(SUM(Productiegegevens[Productie teelt]);
          FILTER(Productiegegevens;Productiegegevens[Soort teelt]="Tomaat");
          FILTER(Productiegegevens;Productiegegevens[Soort teelt]="l'amuse"))))+
      (SUM('Prijs gegevens'[€/kg TastyTom])*CALCULATE(SUM(Productiegegevens[Productie teelt]);
          FILTER(Productiegegevens;Productiegegevens[Soort teelt]="Tomaat");
          FILTER(Productiegegevens;Productiegegevens[Soort teelt]="tastytom")))

      Totaal arbeid =
      ((CALCULATE(SUM('Kosten huur-gas-arbeid'[Arbeid/Uur]);FILTER('Kosten huur-gas-arbeid';'Kosten huur-gas-arbeid'[Afdeling]="1-3")))*SUM(Arbeid[Werkelijke uren Bovenstehuis 1-3]))
      +
      ((CALCULATE(SUM('Kosten huur-gas-arbeid'[Arbeid/Uur]);FILTER('Kosten huur-gas-arbeid';'Kosten huur-gas-arbeid'[Afdeling]="4-6")))*SUM(Arbeid[Werkelijke uren Bovenstehuis 4-6]))
      +
      ((CALCULATE(SUM('Kosten huur-gas-arbeid'[Arbeid/Uur]);FILTER('Kosten huur-gas-arbeid';'Kosten huur-gas-arbeid'[Afdeling]="1-6")))*SUM(Arbeid[Werkelijke uren Neerbroek 1-6]))
      +
      ((CALCULATE(SUM('Kosten huur-gas-arbeid'[Arbeid/Uur]);FILTER('Kosten huur-gas-arbeid';'Kosten huur-gas-arbeid'[Afdeling]="7-8")))*SUM(Arbeid[Werkelijke uren Neerbroek 7-8]))
       
      Totale gaskosten = '3 Gasverbruik measures'[Kosten gasverbruik 1-3]+'3 Gasverbruik measures'[Kosten gasverbruik 1-6]+'3 Gasverbruik measures'[Kosten gasverbruik 4-6]+'3 Gasverbruik measures'[Kosten gasverbruik 7-8]

       

      -------------------------------------------------------------------------------------------------------------------------

      Cumulative Totaal rendement =
      CALCULATE(
          '4 Omzet measures'[Omzet];
          FILTER(
              ALL(Kalender[ISO Week]);
              (Kalender[ISO Week] <= MAX(Kalender[ISO Week]))))

      -

      (TOTALYTD(SUM(Arbeid[Werkelijke uren Bovenstehuis 1-3]);Kalender[Datum])*CALCULATE(SUM('Kosten huur-gas-arbeid'[Arbeid/Uur 1-3]))+
      TOTALYTD(SUM(Arbeid[Werkelijke uren Bovenstehuis 4-6]);Kalender[Datum])*CALCULATE(SUM('Kosten huur-gas-arbeid'[Arbeid/Uur 4-6]))+
      TOTALYTD(SUM(Arbeid[Werkelijke uren Neerbroek 1-6]);Kalender[Datum])*CALCULATE(SUM('Kosten huur-gas-arbeid'[Arbeid/Uur 1-6]))+
      TOTALYTD(SUM(Arbeid[Werkelijke uren Neerbroek 7-8]);Kalender[Datum])*CALCULATE(SUM('Kosten huur-gas-arbeid'[Arbeid/Uur 7-8])))

      -

      ((TOTALYTD(SUM('Kosten huur-gas-arbeid'[Huur 1-3]);Kalender[Datum]))+
      (TOTALYTD(SUM('Kosten huur-gas-arbeid'[Huur 4-6]);Kalender[Datum]))+
      (TOTALYTD(SUM('Kosten huur-gas-arbeid'[Huur 1-6]);Kalender[Datum]))+
      (TOTALYTD(SUM('Kosten huur-gas-arbeid'[Huur 7-8]);Kalender[Datum])))

      -

      (TOTALYTD('3 Gasverbruik measures'[Gasverbruik 1-3 m3 Bovenstehuis];Kalender[Datum])*CALCULATE(SUM('Kosten huur-gas-arbeid'[Gas/M3 1-3]))+
      TOTALYTD('3 Gasverbruik measures'[Gasverbruik 4-6 m3 Bovenstehuis];Kalender[Datum])*CALCULATE(SUM('Kosten huur-gas-arbeid'[Gas/M3 4-6]))+
      TOTALYTD('3 Gasverbruik measures'[Gasverbruik 1-6 m3 Neerbroek];Kalender[Datum])*CALCULATE(SUM('Kosten huur-gas-arbeid'[Gas/M3 1-6]))+
      TOTALYTD('3 Gasverbruik measures'[Gasverbruik 7-8 m3 Neerbroek];Kalender[Datum])*CALCULATE(SUM('Kosten huur-gas-arbeid'[Gas/M3 7-8])))


      Thanks in advance,
       
      Sven