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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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