cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

calculate with text filter

Hello,

 

I have two linked tables : 

 

The first one : 

Capture.PNG

 

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.

 

Capture.PNG

 

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!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: calculate with text filter

@mhendel ,

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])))
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!
You can follow me on LinkedIn

Please take a quick glance on newly created report:
My Report

View solution in original post

19 REPLIES 19
Highlighted
Super User II
Super User II

Re: calculate with text filter

@mhendel ,

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.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
You can follow me on LinkedIn

Please take a quick glance on newly created report:
My Report
Highlighted
Helper III
Helper III

Re: calculate with text filter

@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 : 
 
Capture.PNG

 

I don' understand why it gives me the default phasis for all the projects and not the one defined by the slicer...
 
Regards
 
Highlighted
Super User II
Super User II

Re: calculate with text filter

@mhendel ,

 

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]))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
You can follow me on LinkedIn

Please take a quick glance on newly created report:
My Report
Highlighted
Helper III
Helper III

Re: calculate with text filter

@Tahreem24 thanks again for your halp.

 

I did what you recommend, and i obtain the following erreo : 

 

Capture.PNG

 

Where do i amke a mistake?

 

Regards

Highlighted
Super User II
Super User II

Re: calculate with text filter

@mhendel ,

Show me your measure. I would appreacite your KUODS/THUMBS UP.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
You can follow me on LinkedIn

Please take a quick glance on newly created report:
My Report
Highlighted
Helper III
Helper III

Re: calculate with text filter

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 projet])
Highlighted
Super User II
Super User II

Re: calculate with text filter

You made little mistake for bracket. 

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 projet]))


Take both the Code de Project and phase par defaut under ALLEXCEPT. Just compare your given measure and mine above measure so you'll get an idea.

I would appreacuate your KUDOS.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
You can follow me on LinkedIn

Please take a quick glance on newly created report:
My Report
Highlighted
Post Patron
Post Patron

Re: calculate with text filter

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

Highlighted
Helper III
Helper III

Re: calculate with text filter

@Tahreem24 Thanks.

 

I obtain this :  

 

Capture.PNG

 It s like it is not filtered by the slice...

Btw what is a kudo?

 

Regards

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Power BI Desktop August 2020 Update

Power BI Desktop August 2020 Update

We have great updates this month! Click the link for the video with more info.

Top Solution Authors
Top Kudoed Authors