Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All
Can you please help me create a measure please :
Currently my stock balance ( measure [Processed Stock] for asset type [ASSET_TYPE_ID] = 128 is 1323, for asset type [ASSET_TYPE_ID] = 127 is 3965 and for asset type [ASSET_TYPE_ID] = 126 is 3600.
the balances for [ASSET_TYPE_ID] = 127 and 126 are corect( dont make any ajustments). I need to summarise these two balances and for every 9 units subtract one unit from [Processed Stock], where [ASSET_TYPE_ID] = 128.
that means 3965+3600 = 7565 /9 = 840.55 so subtract 840 from [Processed Stock] where [ASSET_TYPE_ID] = 128
Any idea how to do this ?
Hi @SzymonKl ,
This is very generic however you can try something similar to this:
Stock Revised =
IF (
SELECTEDVALUE ( 'Table'[ASSET_TYPE_ID] ) = 128,
SUM ( 'Table'[Stock] )
- SUMX (
FILTER ( ALL ( 'Table' ), 'Table'[ASSET_TYPE_ID] <> 128 ),
'Table'[Stock]
),
SUM ( 'Table'[Stock] )
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi Miguel
Unfortunately, this is not working.
'Table'[Stock]is a measure not column, and the data is connected via direct query
Hi @SzymonKl ,
If this is a measure then just replace the column by the measure:
Stock Revised =
IF (
SELECTEDVALUE ( 'Table'[ASSET_TYPE_ID] ) = 128,
[Stock]
- SUMX (
FILTER ( ALL ( 'Table' ), 'Table'[ASSET_TYPE_ID] <> 128 ),
[Stock]
),
[Stock]
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThe Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |