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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
yellow43
Helper I
Helper I

New measure with DISTINCTCOUNT with FILTER

Hello community!

 

I am having the following issue:

 

I would like to have a Card with the number of product (SKU) that have less than 100 units sold.

As you can see on table below, I have 25 SKU, but the card shows 28 SKU.

I have created a new measure with the following:

 

Products < 100 = CALCULATE (

    DISTINCTCOUNT ( Table[SKU] ), 

    FILTER(ALL(Table[SKU]), [Total Sales] < 100

))

 

Also tried:

 

Products <100 = COUNTROWS(
FILTER(VALUES(Table[SKU]); [Total Sales]<100))

 

But it seems that is not working as I expected, because it shows 28.

This numbers of sales are calculated based on measure that I have created:

 

Total Sales = SUM(Table[Sales_Invoice])

 

yellow43_0-1659392094926.png

 

Thank you in advance for your help.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I assume the measure needs to provide count of products that show less than 100 per selected day.

If you have a Calendar Dimension Table, please try the below measure whether it works.

 

 

Products < 100 =
CALCULATE (
    DISTINCTCOUNT ( Table[SKU] ),
    FILTER ( SUMMARIZE ( Table, Table[SKU], Calendar[Date] ), [Total Sales] < 100 )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @yellow43 ;

You could try it.

Products < 100 =
CALCULATE (
    DISTINCTCOUNT ( Table[Products] ),
    FILTER ( ALLSELECTED ( 'Table' ), [Total Sales] < 100 )
)


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

Jihwan_Kim
Super User
Super User

Hi,

I assume the measure needs to provide count of products that show less than 100 per selected day.

If you have a Calendar Dimension Table, please try the below measure whether it works.

 

 

Products < 100 =
CALCULATE (
    DISTINCTCOUNT ( Table[SKU] ),
    FILTER ( SUMMARIZE ( Table, Table[SKU], Calendar[Date] ), [Total Sales] < 100 )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
Europe Fabric Conference

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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