Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Clint
Helper V
Helper V

Filter issue on Measure

Hello,

 

I have the following measure that simply indicates via a "Y" or"N" if a task (Project Online dataset) is done or not.  These tasks (from the Tasks table)  live in a table visual on a page that the user drills thru to based on the Project Name field (from the Projects table).  The Projects table and Tasks table or connected in a One to Many relationship via the ProjectID field.

 

Task Done Y/N =
VAR TaskDone =SUMX('Tasks','Tasks'[TaskPercentWorkCompleted])
Return
CALCULATE(
IF(TaskDone=100,"Y","N"
)

The problem is adding this measre to the table results in the table returning all tasks instead of just the tasks from the project the user drilled thru on.  I know I need account for the project name filter but I don't know how to write this in the DAX.  I tried the below syntax but it doesn't workl

 

Task Done Y/N =
VAR TaskDone =SUMX('Tasks','Tasks'[TaskPercentWorkCompleted])
Return
CALCULATE(
ALLEXCEPT('Projects','Projects'[Project Name]),
IF(TaskDone=100,"Y","N"
))
4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @Clint ,

 

Could you please share your sample data and expected result to me if you don't have any Confidential Information? Please upload your files to OneDrive for Business and share the link here.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-eachen-msft ,

 

We decided to use conditional formatting instead of a Y/N so this measure became a moot issue.

Mariusz
Community Champion
Community Champion

Hi @Clint 

 

Create a Column instead if you want the result to be part of a filter context.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Doesn't Calculate introduce Filter context?

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.