Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

All Function doest not work

daxHi Everyone.

 

Im trying to create a measure that gives me the average price for ALL years in my data. But I have followed the instructions on how to use ALL but when I select a a year, my measure is still responding to my filter. Any ideas?

 

 

The second column is the same measure without all function just average x

 

And the third and last as screenshot below with all. 

 

As you can see when i select a year both measures filter by the year. I need the last to no respond to my slicer filters

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

    Sorry for late repsonse. Please try to update the formula of measure All_Yr_NF as below:

    All_Yr_NF = CALCULATE( AVERAGEX(VALUES(Winter_Contracts_Zema[Contract_Year]),[Final_Price_Norm]),ALL(Winter_Contracts_Zema))

    Best Regards

    Rena

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    It seems the applied filters were not ignored even though use ALL function in measure All_Yr_NF, right? Could you please provide some sample data in table Winter_Contracts_Zema (exclude the sensitive data) and the formula of measure Final_Price_Norm in order to make troubleshooting? Thank you.

    In addition, you can review this blog and check if it can help you solve the problem.

    Best Regards
    Rena

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

       

      Thanks so much!

       

      This the sample data

       

      The last 3 columns are calculated columns at Power Query Level

      Norm_Price: PRice + Parameter Value

      Percent Change: By python script day over day change

      Norm_Change: By Python:  Column 1 = 1 Column 2= Previous row 1 (Percent change * Previous row)

       

      and my last measure to get price normalized is 

      Final_Price_Norm = sum(Winter_Contracts_Zema[Norm_Change]) - 1
       
      Im just substracting 1 to everything.

       

      DateContract_YearContract_TypeLocationPriceTrade_PeriodContract_KeyTrade DayNorm_PricePercent_ChangeNorm_Change
      393872008WinterPG&E-Citygate-0.132007/20082007/2008-FC 200811.8701
                 
      393882008WinterPG&E-Citygate-0.162007/20082007/2008-FC 200821.84-0.016040.983957
                 
      393912008WinterPG&E-Citygate-0.1352007/20082007/2008-FC 200831.8650.0135870.997326
                 
      393922008WinterPG&E-Citygate-0.122007/20082007/2008-FC 200841.880.0080431.005348
                 
      393932008WinterPG&E-Citygate-0.112007/20082007/2008-FC 200851.890.0053191.010695
                 
      393942008WinterPG&E-Citygate-0.122007/20082007/2008-FC 200861.88-0.005291.005348
                 
      393952008WinterPG&E-Citygate-0.122007/20082007/2008-FC 200871.8801.005348
                 
      393982008WinterPG&E-Citygate-0.132007/20082007/2008-FC 200881.87-0.005321
                 
      393992008WinterPG&E-Citygate-0.142007/20082007/2008-FC 200891.86-0.005350.994652
                 
      394002008WinterPG&E-Citygate-0.142007/20082007/2008-FC 2008101.8600.994652
                 
      394012008WinterPG&E-Citygate-0.162007/20082007/2008-FC 2008111.84-0.010750.983957
                 
      394022008WinterPG&E-Citygate-0.162007/20082007/2008-FC 2008121.8400.983957
                 
      394052008WinterPG&E-Citygate-0.172007/20082007/2008-FC 2008131.83-0.005430.97861
                 
      394062008WinterPG&E-Citygate-0.152007/20082007/2008-FC 2008141.850.0109290.989305
                 
      394072008WinterPG&E-Citygate-0.152007/20082007/2008-FC 2008151.8500.989305
                 
      394092008WinterPG&E-Citygate-0.152007/20082007/2008-FC 2008161.8500.989305
                 
      394122008WinterPG&E-Citygate-0.1452007/20082007/2008-FC 2008171.8550.0027030.991979
                 
      394132008WinterPG&E-Citygate-0.1352007/20082007/2008-FC 2008181.8650.0053910.997326
                 
      394142008WinterPG&E-Citygate-0.1152007/20082007/2008-FC 2008191.8850.0107241.008021
      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

        Sorry for late repsonse. Please try to update the formula of measure All_Yr_NF as below:

        All_Yr_NF = CALCULATE( AVERAGEX(VALUES(Winter_Contracts_Zema[Contract_Year]),[Final_Price_Norm]),ALL(Winter_Contracts_Zema))

        Best Regards

        Rena