Forum Discussion

tonyc's avatar
tonyc
Frequent Visitor
2 years ago

DAX not running%

I have CY% in a measure. For some reason my CY% is a running %.

 

How do I make CY% is not a running %?

 

Here is DAX in CY% 

A WEIGHT CY =
CALCULATE(
    [A WEIGHT%] ,
    DATEADD(
        'Date'[Date],
        0,
        YEAR
    )
 
KeyCY%  KeyCY%
A12  A39
B13  B39
C14  C39
TOTAL39    

 

Thanks

7 Replies

  • rubayatyasmin's avatar
    rubayatyasmin
    Community Champion

    Hey, tonyc 

     

    use ALL function. For example:

     

    A WEIGHT CY =
    CALCULATE(
    [A WEIGHT%],
    FILTER(
    ALL('Date'),
    'Date'[Year] = MAX('Date'[Year])
    )
    )

     

    this should remove filters if any. 

    • tonyc's avatar
      tonyc
      Frequent Visitor

      No.. it didn't work.  I still get the running total.

      Let's try a different approach.  I want to calculate the Result% column using a measure.

      This is what I am expecting -

       

      KeyZ1%Z2%Result %
      A20%80%0.206793
      B30%70%0.181431
      C10%90%0.232156

       

      A - 0.206793 = (20/100* 0.0038935516)+(80/100 * 0.2575179612)

      B  - 0.181431 - (30/100* 0.0038935516)+(70/100 * 0.2575179612)

       

      0.0038935516 and 0.2575179612 are generated from the measure and I want all calculations using these 2 constants variable

      Type 1 WeightType 2 Weight
      0.0038940.257518

       

      Here is my measure for Result%

      Result % =
       ( [Z1%] * [Type 1 Weight]) +  ( [Z2%] * Type 2 Weight )
       
      Thank you.. let me know if you want more information.