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 there,
I just need help calculating dynamic totals within Power BI for the following measure shown below . Essentially, I am calculating the last recorded Average Cost and QTY On Hand across my 3 branches for a specific product ( TXWHSE) to get my Inventory Value. But by using MAXX I know why my totals are based on the MAXX value but my desired output is to SUM the total inventory Values across all 3 of my branches as my total amount. In this case, it should show $52,455.15 . How would I go about doing that ?
Hi,
INVENTORY VALUE =
VAR LASTQ0H =
CALCULATE (
MAXX ( INTRAN00, INTRAN00[TXQOH] ),
LASTDATE ( INTRAN00[TRANSACTION DATE] )
)
VAR LASTAVGCOST =
CALCULATE (
MAXX ( INTRAN00, INTRAN00[NEW AC PER] ),
LASTDATE ( INTRAN00[TRANSACTION DATE] )
)
VAR MYTABLE =
SUMMARIZE (
INTRAN00,
INTRAN00[TXWHSE],
"LastQ0H",
CALCULATE (
MAXX ( INTRAN00, INTRAN00[TXQOH] ),
LASTDATE ( INTRAN00[TRANSACTION DATE] )
),
"LastAvgCost",
CALCULATE (
MAXX ( INTRAN00, INTRAN00[NEW AC PER] ),
LASTDATE ( INTRAN00[TRANSACTION DATE] )
)
)
RETURN
IF (
HASONEVALUE ( INTRAN00[TXWHSE] ),
LASTAVGCOST * LASTQ0H,
SUMX ( MYTABLE, [LastAvgCost] * [LastQ0H] )
)
Regards
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 |
---|---|
43 | |
23 | |
21 | |
15 | |
15 |
User | Count |
---|---|
46 | |
31 | |
30 | |
18 | |
18 |