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

Calculate the count which filter contains two conditions from different column

Hi Everyone,

 

I would like to create a metrix in PBI as below.

Example.PNG

It is ok for me to create the measure about Resolved%. However, only P1-P3 Gap,# is different to realize.

My measure is:

calculate wrong.PNG

The CALCULATE can't calculate the expression which contains multiple columns .

I need to calculate the count which "Column" = "No" and MappedPriority isn't P4-P5.

The Gap means the count of items which "Column" = "No".

Could you help me te solve this?

Thanks in advance.

 

Regards

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft
Microsoft

Hi @Kelly_Zhu,

 

Please modify your measure formula to:

Measure 4 =
CALCULATE (
    COUNT ( OpenBacklog[Column] ),
    FILTER (
        OpenBacklog,
        AND ( OpenBacklog[Column] = "No", OpenBacklog[MappedPriority] <> "P4" )
    )
)

Best regards,
Yuliana Gu

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

View solution in original post

6 REPLIES 6
MarcelRossouw
Frequent Visitor

I just wanted to say thanks for this solution, i'd been looking for over a day on an actual solution to filtering two specific values from two specific columns in a measure!

v-yulgu-msft
Microsoft
Microsoft

Hi @Kelly_Zhu,

 

If my priginal reply is helpful to your scenario, would you please kindly mark it as an answer? If you still have any concern, please feel free to ask.

 

Thanks,
Yuliana Gu

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

Ok. Thanks for your reminder.

v-yulgu-msft
Microsoft
Microsoft

Hi @Kelly_Zhu,

 

Please modify your measure formula to:

Measure 4 =
CALCULATE (
    COUNT ( OpenBacklog[Column] ),
    FILTER (
        OpenBacklog,
        AND ( OpenBacklog[Column] = "No", OpenBacklog[MappedPriority] <> "P4" )
    )
)

Best regards,
Yuliana Gu

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

View solution in original post

Hi Yuliana,

 

Thanks a lot!

 

BTW could you help me to hide the blank column?

 New Query.PNG

 

Thanks,

Kelly

Hi @Kelly_Zhu,

 

Unfortunately, there is no such a visibility property to conditionally show/hide a column in matrix. you could submit your idea on the link below: https://ideas.powerbi.com/forums/265200-power-bi-ideas

 

Regards,
Yuliana Gu

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

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors