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.
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:
Name | Qtd Needed | When 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 | 3 | 02/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:
Name | Inspection Stock | Storage Name | Unrestricted 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,
Name | Qtd Needed | Stock | Status |
Item 1 | 10 | 18 | OK |
Item 2 | 8 | 6 | 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".
Paint.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.
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?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
81 | |
70 | |
62 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |