I need to compare whether the values shifted two month back is blank using DAX if and…
Jump to turn (8)
- 1I need to compare whether the values shifted two month back is blank using DAX i
- 2NO. See the example Client|DATE|AMOUNT|New measure 1|10.01.2023|100|TRUE 1|09.01
- 3Provide your own numeric example
- 4You repeated mine. Create your own
- 5You are wrong. For clinet B and Date 2022-12-01 there is a row with Date shifted
- 6Does your code reproduce this output? Or you only changed the output&
- 7This code yields an error VAR SelectedDate = '5 14'[Period] Cannot find name '[P
- 8I also need to retriete the value of Amount shifted two months back under the sa
- User
I need to compare whether the values shifted two month back is blank using DAX if and DATEADD function. Help with that
- Assistant
To compare if the values shifted two months back is blank using DAX and the DATEADD function, you can use the following formula:
codeIsBlankTwoMonthsBack = IF( ISBLANK( CALCULATE( FIRSTNONBLANK(Table[Value], ), DATEADD(Table[Date], -2, MONTH) ) ), TRUE(), FALSE() )This formula calculates the first non-blank value from the
Table[Value]column, shifted two months back from theTable[Date]column. If the result is blank, it returnsTRUE; otherwise, it returnsFALSE.Make sure to replace and with the actual column names in your dataset.