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

Frequent Visitor

## How to get the count of Products where actuals+forecast values are greater than 0 in a card visual?

Hi All,

In a card visual, I have used a measure which takes the distinct count of product no. Now in additional to that, I have to include a logic to get the distinct count of product no where Actuals + Forecast > 0. In the below example, the distinct count of product no where Actuals + Forecast > 0 is 4. This logic I need to achieve in a Card visual. Can anybody help me with the logic here?

 Product No Actuals Forecast 1 0 30 2 0 0 3 65 100 4 50 0 5 0 0 6 100 150

Thanks in advance!!

1 ACCEPTED SOLUTION
Community Support

HI @MadhumithaV_26,

I'd like to suggest you extract the 'product no' field values based on filter conditions, then you can use countrows function with these field values to get the count.

formula =
CALCULATE (
COUNTROWS ( VALUES ( Table[Product No] ) ),
FILTER ( ALLSELECTED ( Table ), [Actual] + [Forecast] > 0 )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
1 REPLY 1
Community Support

HI @MadhumithaV_26,

I'd like to suggest you extract the 'product no' field values based on filter conditions, then you can use countrows function with these field values to get the count.

formula =
CALCULATE (
COUNTROWS ( VALUES ( Table[Product No] ) ),
FILTER ( ALLSELECTED ( Table ), [Actual] + [Forecast] > 0 )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

## Helpful resources

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Join our Community Sticker Challenge

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

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

#### Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors