The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Looking for assistance for a measure for the last column in example below, if a hub building has inventory, show yes for all buildings that fall under that hub.
Building | Building Type | Servicing Hub | Inv | Hub Has Inv. |
A | Hub | A | 10 | Y |
B | Trad | A | 8 | Y |
C | Trad | A | 5 | Y |
D | Hub | D | 0 | N |
E | Trad | D | 10 | N |
F | Trad | D | 2 | N |
Solved! Go to Solution.
Hi @CRSB ,
For your proposed new table, I have also created a table.
I think you can create the following DAX code for your needs.
Column =
IF (
'Table'[Servicing Hub] = "A"
&& 'Table'[Item] = "A"
&& 'Table'[Inv] > 0,
"Y",
"N"
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
this worked, but i forget one of my tables has item # as a column, so how could i modify to check if the hub/item combonation has inventory?
Flag =
IF(CALCULATE(
MIN(Table[Inv]),
ALLEXCEPT( Table, Table[Servicing Hub] ),Table[Building Type]="HUB",Table[Item Column]="Your Condition"
)=0,FALSE(),TRUE())
I can't get this to work, what is the "Your Condition"?
below would be the table
Building | Building Type | Servicing Hub | Item | Inv | Hub Has Inv. |
A | Hub | A | A | 10 | Y |
B | Trad | A | A | 8 | Y |
C | Trad | A | A | 5 | Y |
D | Hub | D | B | 0 | N |
E | Trad | D | B | 10 | N |
F | Trad | D | B | 2 | N |
A | Hub | A | C | 0 | N |
G | Trad | A | C | 10 | N |
"Your Condition" was a placeholder.
Because you hadnt mentioned the condition that you would like to check.So just replace "Your Condition" the value that you would want to check.
Hi @CRSB ,
For your proposed new table, I have also created a table.
I think you can create the following DAX code for your needs.
Column =
IF (
'Table'[Servicing Hub] = "A"
&& 'Table'[Item] = "A"
&& 'Table'[Inv] > 0,
"Y",
"N"
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
try this:
Hub Has Inv =
VAR HubWithInv =
CALCULATE(
MAX('Table'[Inv]),
FILTER(
ALL('Table'),
'Table'[Servicing Hub] = MAX('Table'[Servicing Hub])
)
)
RETURN IF(HubWithInv > 0, "Y", "N")
User | Count |
---|---|
14 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
28 | |
17 | |
12 | |
7 | |
5 |