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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

filter a column by another column's specific values

Hi,

 

Please see attached picture. I have this table containing working days (wd) used for solving change requests. The satus shows wether the request is finalized (final check approved) or is still not resolved (to be reviewed etc.). On this way we see how many working days that have been spent for different statuses. 

 

I want to make a measure that can filter the working days that are finalized and those that are still to be reviewed. I know I can do it by the filter pane, but I want to to it in a measure/dax so I can compare it in a stacked colum chart (see the second picture; its just something i made up and not based on correct numbers).

 

I am new to Power BI so really appreciate the help.

 

 

j.PNGk.PNG

5 REPLIES 5
Anonymous
Not applicable

Hi, something like this?

 

WD Finalized = CALCULATE(SUM('Table'[WD]), KEEPFILTERS('Table'[Status]="Final check approved"))

WD Pending = SUM('Table'[WD]) - [WD Finalized]

 

Or you can create the 2nd one using a list of statuses to include like the first one but with many conditions in KEEPFILTERS. (Status IN { "Status 1", "Status 2", ...} )

 

Best Regards

Ulf

az38
Community Champion
Community Champion

Hi @Anonymous 

if I understand you correct ot will be enough to create a calculated table like

Filtered table = FILTER( 'Table',
'Table'[Status]="final check approved" || LEFT('Table'[Status], 14) = "To Be Reviewed"
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Hi @az38 

 

Thanks for your reply. 

 

The screenshot I took is just a slice of a much larger table that is eventually going to be integrated from another datasource. I need a measure that filter out those who have "final check approved" and "final check rejected". I need another measure that filter out "to be reviewed (all of those kinds)". 

az38
Community Champion
Community Champion

@Anonymous 

sorry, do not understand. previous solution is not ok?

you can do something like above, like

Filtered table = FILTER( 'Table',
'Table'[Status]="final check approved" || 'Table'[Status]="final check rejected"
)

or

Filtered table = FILTER( 'Table',
LEFT('Table'[Status], 14) = "To Be Reviewed"
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

I actually want to calculate the average. Could you help me correct this one:

Measure 2 = CALCULATE(AVERAGE('Cr and leadtime'[WD]), 'Cr and leadtime'[Status]="final Check Approved" && "Final Check Rejected")
 
It works  if I dont use the && but I want to filter for both. Whats the right way to write the syntax?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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