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
Dear ,
Kindly please correct me this measure in a column : ( it is returning the value of the text combined ReceivedIssued or RecievedReceived for the inventory )
Solved! Go to Solution.
@bhelou Something along the lines of:
Material_Status =
SWITCH(TRUE(),
XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]= "Account alias" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value]<0,"Issued",
XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]= "Account alias" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value]>=0,"Received",
XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]="Inventory" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value] <0,"Issued",
XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]="Inventory" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value] >=0,"Received",
"Unknown"
)
You can just keep tacking on logical conditions to your heart's content.
@bhelou Try:
Material_Status =
IF(
XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]= "Account alias",
IF(XX_AWPT_MTL_MATERIAL_TRX[Net_Value]<0,"Issued","Received"),
IF(XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]="Inventory" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value] <0,"Issued","Received")
)
Great it worked for 2 conditions , now i have multiple conditions in the source type : i tried the same with && it gave me for the purchase orders : Received from ProjectReceived
Many Thanks @Greg_Deckler
@bhelou Use SWITCH(TRUE(), ...)
SWITCH function (DAX) - DAX | Microsoft Docs
Nested IF's are awful.
Okay ill try to use switch , Please can you show me a sample of my dax how to use it ?
Many Thanks @Greg_Deckler
@bhelou Something along the lines of:
Material_Status =
SWITCH(TRUE(),
XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]= "Account alias" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value]<0,"Issued",
XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]= "Account alias" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value]>=0,"Received",
XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]="Inventory" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value] <0,"Issued",
XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]="Inventory" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value] >=0,"Received",
"Unknown"
)
You can just keep tacking on logical conditions to your heart's content.
Thank you worked very good .
T
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 130 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |