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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
MarcelRossouw
Advocate I
Advocate I

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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