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.
Hi,
I have following inventory history table with three columns: report date, warehouse location & inventory value:
I'm trying to present only current inventory state.
The following formula calculates correctly currrent inventory value (sum of rows for the last report date):
But when I'm trying to replace [Value] column with it, the table is still showing unwanted rows, though the sum is ok:
Any idea how to remove them, to achieve this result:?
Here is the link to pbix file - hope it works.
Solved! Go to Solution.
Hi, @Krzysztof_Hyla ;
Please try it.
Current Inventory Balance =
IF(MAX([Date])=CALCULATE( LASTDATE('Warehouse History'[Date]),ALL('Warehouse History')),
CALCULATE(
SUM('Warehouse History'[Value]),
LASTDATE('Warehouse History'[Date])))
The final output is shown below:
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.
Hi, @Krzysztof_Hyla ;
Please try it.
Current Inventory Balance =
IF(MAX([Date])=CALCULATE( LASTDATE('Warehouse History'[Date]),ALL('Warehouse History')),
CALCULATE(
SUM('Warehouse History'[Value]),
LASTDATE('Warehouse History'[Date])))
The final output is shown below:
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.
This gave me exactly what I needed - thanks a lot!
I have used this measure, but no luck so far:
Here is the exact code I've used:
@Krzysztof_Hyla , Try a measure likethis for current inventory
Measure =
VAR __id = MAX ('Warehouse History'[Location] )
VAR __date = CALCULATE ( MAX('Warehouse History'[Date] ), ALLSELECTED ('Warehouse History' ), 'Warehouse History'[Location] = __id )
CALCULATE ( SUM('Warehouse History'[Value]), VALUES ('Table'[Location] ),'Warehouse History'[Location] = __id,'Warehouse History'[Date] = __date )
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 |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |