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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
Employee

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
Anonymous
Not applicable

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
Employee
Employee

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
Employee
Employee

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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