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

How to create a chart with how many pieces i have ok, and how many i dont.

Hello everyone,

 

I'm creating a BI for my company that shows me how many pieces i have in stock and if the amount i have is enough to "X" days of production. 

 

1. I have multiple tables with multiple infos,

   1.1, table 1 shows me how many pieces i need to use every day:

       

NameQtd NeededWhen Needed
Item 1   2  02/16/2022
Item 2   4  02/16/2022
Item 1   3  02/18/2022
Item 1   5  02/19/2022
Item 2   1  02/19/2022
Item 2   302/23/2022

 

 

 

So to reach day 23, I'll need 10 pieces of item 1 and 8 pieces of item 2.

 

   1.2, table 2 shows me how many pieces i have of each items in all my stocks:

 

NameInspection StockStorage NameUnrestricted stock
Item 1   5   Storage 1     0
Item 1   0   Storage 2     3
Item 1   0   Storage 3     10
Item 2   0   Storage 1      6

 

    So i have 18 pieces of item 1 available to use in production, and 6 pieces of Item 2 available to use in production

 

What i need is to know, how many parts that i have that is OK (i dont need any more parts to reach the "X" day), howmany parts i have Partialy on hands (Stock total > 0) and how many parts i dont have at all (Stock = 0)

So to do this, i've created a Measure that says:

 

 

 

 

 

 

Measure 1 = 

IF(SUM(Qtd Needed) <= SUM(Inspection Stock)+SUM(Unrestricted stock]), "OK",

	IF(SUM(Qtd Needed) > SUM(Inspection Stock)+SUM(Unrestricted stock]) && SUM(Inspection Stock)+SUM(Unrestricted stock]) = 0, "Warning",

		IF(SUM(Qtd Needed) > SUM(Inspection Stock)+SUM(Unrestricted stock]) && SUM(Inspection Stock)+SUM(Unrestricted stock]) > 0,
			"Partialy on Hands")))

 

 

 

 

 

 


Guess what, when i use it in a table chart, it works fine, shows my all my parts and its status, however when i try to use it in a pizza chart the power bi doesnt allow me to use a measure as value, 

 

NameQtd NeededStockStatus
Item 1    1018   OK
Item 2    86   Partialy on Hands

 

So, how can i apply this to a Pizza Chart that shows me how many items and the percentage of itens "ok", "partialy on hands", and "warning". 

 

Vieiraguilherme_0-1645056224299.pngPaint.jpg 

 

 

PS: i'm using a date slicer as a filter, so, if i select a day 100, it will get how many pieces i need to reach the day 100, and return the status.

 

Unfortuately i cant share the real infos because is private information. 

 

 

1 REPLY 1
lbendlin
Super User
Super User

Does your business process actually require this to be a measure (ie is it affected by user filters)  or could you implement it as a calculated column?

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.