Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I am new to DAX and Iam trying to convert the below column to measure, but somehow didnot found the luck, can someone help me on this
IF ('Table A'[Ship Date] = BLANK (),BLANK (),
IF ('Table A'[Order Creation Date] = BLANK (),BLANK (),
IF ('Table A'[Ship Date] - 'Table A'[Order Creation Date] < 0,-1,
'Table A'[Ship Date] - 'Table A'[Order Creation Date])))
TIA
Solved! Go to Solution.
Hi, @Sri57
wrap your column name in MIN(), MAX()
use @some_bih code with MIN() or MAX()
like below
measure =
IF (
ISBLANK ( min('Table A'[Ship Date] )),
BLANK (),
IF (
ISBLANK ( min('Table A'[Order Creation Date] )),
BLANK (),
IF (
DATEDIFF ( min('Table A'[Order Creation Date]), min('Table A'[Ship Date]), DAY ) < 0,
-1,
DATEDIFF ( min('Table A'[Order Creation Date]), min('Table A'[Ship Date]), DAY )
)
)
)
Hi, @Sri57
wrap your column name in MIN(), MAX()
use @some_bih code with MIN() or MAX()
like below
measure =
IF (
ISBLANK ( min('Table A'[Ship Date] )),
BLANK (),
IF (
ISBLANK ( min('Table A'[Order Creation Date] )),
BLANK (),
IF (
DATEDIFF ( min('Table A'[Order Creation Date]), min('Table A'[Ship Date]), DAY ) < 0,
-1,
DATEDIFF ( min('Table A'[Order Creation Date]), min('Table A'[Ship Date]), DAY )
)
)
)
Hi , kindly share a sample of the Pbix file
@bhelou please find the attached sample file in
https://www.dropbox.com/s/tm3orr9kpqvlatt/Test.pbix?dl=0
try this :
Measure =
IF (
ISBLANK('Table A'[Ship Date]) || ISBLANK('Table A'[Order Creation Date]),
BLANK(),
IF (
'Table A'[Ship Date] - 'Table A'[Order Creation Date] < 0,
-1,
'Table A'[Ship Date] - 'Table A'[Order Creation Date]
)
)
it is getting error like cannot find name under [Ship Date] and [Order Creation Date] columns when I try this
Hi @Sri57
Try below (helped with AI)
Measure =
IF (
ISBLANK ( 'Table A'[Ship Date] ),
BLANK (),
IF (
ISBLANK ( 'Table A'[Order Creation Date] ),
BLANK (),
IF (
DATEDIFF ( 'Table A'[Order Creation Date], 'Table A'[Ship Date], DAY ) < 0,
-1,
DATEDIFF ( 'Table A'[Order Creation Date], 'Table A'[Ship Date], DAY )
)
)
)
Proud to be a Super User!
it is getting error like cannot find name under [Ship Date] and [Order Creation Date] columns when I convert it to measure
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 17 | |
| 10 | |
| 7 | |
| 6 |