The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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 |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |