Forum Discussion
bhelou
Responsive Resident
5 years agoIf Condition ( text and value )
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 ) Material_Status = IF ( ...
- 5 years ago
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
Responsive Resident
5 years agoGreat 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
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 from Project","Received from Project"))
&
IF(
XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE] = "Purchase order",
IF(XX_AWPT_MTL_MATERIAL_TRX[Net_Value]<0,"Issued","Received"),
"Received"
)
Many Thanks Greg_Deckler
Greg_Deckler
Community Champion
5 years ago- bhelou5 years ago
Responsive Resident
Okay ill try to use switch , Please can you show me a sample of my dax how to use it ?
Many Thanks Greg_Deckler
- Greg_Deckler5 years ago
Community Champion
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.
- bhelou5 years ago
Responsive Resident
Thank you worked very good .
T