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.
I've got this exact senario what I would typicall use a "If(OR..." statement, but I can't because I can only do 2 arguments...I think I need to use SWITCH but I'm not sure. Can someone give me the DAX formula for the following...
If trandata[account] number is between 6001-6098, or 7030, 7926 or 9071 then retreive the values from trandata[amount]
Please and thank you!!!
Solved! Go to Solution.
Hi, lets try with this calculated column:
M =
IF (
Trandata[Account] >= 6001
&& Trandata[Account] <= 6098
|| Trandata[Account] = 7030
|| Trandata[Account] = 7926
|| Trandata[Account] = 9071;
Trandata[Amount]
)
Regards
Victor
Hi, lets try with this calculated column:
M =
IF (
Trandata[Account] >= 6001
&& Trandata[Account] <= 6098
|| Trandata[Account] = 7030
|| Trandata[Account] = 7926
|| Trandata[Account] = 9071;
Trandata[Amount]
)
Regards
Victor
A shorter version will be:
M = IF ( Trandata[Account] >= 6001 && Trandata[Account] <= 6098 || Trandata[Account] IN { 7030; 7926; 9071 }; Trandata[Amount] )
Regards
Victor
Thanks Vvelarde for the super quick reply!!
I tried the both options...but getting an error
The syntax for ';' is incorrect. (DAX(IF ( Trandata[Account] >= 6001 && Trandata[Account] <= 6098 || Trandata[Account] IN { 7030; 7926; 9071 }; Trandata[amount]))).
Do I have something wrong?
I pasted your exact DAX in.
I changed the
;
to a
,
and I think that might do it...trying now...
I was able to get this to work...
M = IF ( Trandata[account] >= 6001 && Trandata[Account] <= 6098 || Trandata[Account] = 7030 || Trandata[Account] = 7926 || Trandata[Account] = 9071, Trandata[Amount],blank() )
I like the shorter option you proposed, but could not get it to work.
lol. Darn regional settings lol.
Thank you though. Formula is working awesome :-)!!!!!
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 |
---|---|
111 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |