Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

calculate with text filter

Hello,

 

I have two linked tables : 

 

The first one : 

 

For each Projects code, "phase par défaut" is unique.

 

I have the second one called budget, contains an amount of hour per phasis.

 

Tables are linked by code de projet and i have a slicer with that code.

 

 

I have to extract the amount of hours for the default phasis, with a measure.  

 

Someting like : budget current phasis = calculate(SUM('budget'[heures prévus]),(a filter to find what i want"))

 

My problem is that i can't find the way to filter that...

 

Can you help me ?

 

Thanks!

 

  • Anonymous ,

    So here you go:

    Budget phase = CALCULATE(sum('public budget'[Heures prévus]),FILTER('public budget','public budget'[Phase de projet]=RELATED('public financial-overview'[Phase par défaut])))
     

19 Replies

  • Anonymous ,

    Try using ALLEXCEPT.

    = CALCULATE(SUM('budget'[heures prévus]),ALLEXCEPT(TableNAme,TableName[Phase Par defaut]))

    NOTE: Put table name and required column name on which you want amount in ALLEXCEPT DAX function.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Tahreem24  : thanks for your help.

      I tried what you wrote me :

      Budget phase = CALCULATE(sum('public budget'[Heures prévus]), ALLEXCEPT('public financial-overview','public financial-overview'[Phase par défaut]))
       
      And unfortunately i have the following : 
       

       

      I don' understand why it gives me the default phasis for all the projects and not the one defined by the slicer...
       
      Regards
       
      • Tahreem24's avatar
        Tahreem24
        Icon for Super User rankSuper User

        Anonymous ,

         

        Please update your measure like the below:

        Budget phase = CALCULATE(sum('public budget'[Heures prévus]), ALLEXCEPT('public financial-overview','public financial-overview'[Phase par défaut],'public financial-overview'[Code de Project]))

         

  • negi007's avatar
    negi007
    Icon for Community Champion rankCommunity Champion

    Anonymous  If your problem still not resolved would apprecite if you could share your powerbi file.