The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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