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
Achnito
New Member

Count Products Currently in Supply for each Brand

Dear Power BI Community,

 

I am stock on a seemingly simple question, that I just cant wrap my head around.

I am looking to supply a table visual, that lists each brand by how many products it contains, and how many of them that are currently in stock, like shown:

 

Achnito_0-1642160480724.png

 

 

My data-model looks like this:

Achnito_0-1642160068338.png

 

On a side note, I have a Measure called "Current Stock Level, Qty", which works perfectly

I tried to use this in an IF-statement, (this does only work when showing on a unique product level), like:

IF(

Current Stock Level, Qty > 0,

COUNT(Product Number)

)

 

The solution might be simple, but I cannot seem to find it.

I hope to find a solution. Many thanks in advance! 🙂

3 REPLIES 3
amitchandak
Super User
Super User

@Achnito , assuming brand is coming from Product table

Then

with stock product measure

 

calculate(count(product[product]) , filter(fct_stock, fct_stock[Qty' > 0))

 

the second measure can be

 

count(product[product])

@amitchandak 

Thank you for taking your time to answer my question.

We are almost there!

 

Here's what I did so far:

Products, count =

COUNT('Product'[Product Number])

 
 
in Stock, count =
CALCULATE(
COUNT('Product'[Product Number]),
FILTER(
'fct Stock',
CALCULATE(
SUM('fct Stock'[Quantity]),
'Date'[Date] = TODAY() -1
) > 0
)
)
 
The Problem
I'd like this measure to ignore any date-filters.
Unfortunately, If I choose a date filter that does NOT include today's date, the measure returns blank.
Achnito_2-1642168147039.png

Hi @Achnito 

please provide more details, then we can work on it further

(1) a sample file, you can replace raw data with bogus data to protect your privacy.

(2) or provide some sample data that fully covers your issue/question

(3) give your expected result based on the sample you provide

Kindly note: Please ensure the data in sample is concise and representative.

Thanks.

 

 

Best Regards,

Community Support Team _Tang

If this post helps, 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.