Forum Discussion
Calculated Column returns Null value or not all values
- Anonymous4 years ago
Hi ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can update the formula of the calculated column as below:
Column_NextDate = CALCULATE ( MAX ( 'Case Workgroup Assignement History (USE)'[Created_Date] ), FILTER ( 'Case Workgroup Assignement History (USE)', 'Case Workgroup Assignement History (USE)'[Index] = EARLIER ( 'Case Workgroup Assignement History (USE)'[Index] ) + 1 ) )Or you can create a meausre as below to get it:
NextDate = VAR _selindex = SELECTEDVALUE ( 'Case Workgroup Assignement History (USE)'[Index] ) VAR _preindex = CALCULATE ( MIN ( 'Case Workgroup Assignement History (USE)'[Index] ), FILTER ( ALLSELECTED ( 'Case Workgroup Assignement History (USE)' ), 'Case Workgroup Assignement History (USE)'[Index] > _selindex ) ) RETURN CALCULATE ( MAX ( 'Case Workgroup Assignement History (USE)'[Created_Date] ), FILTER ( ALLSELECTED ( 'Case Workgroup Assignement History (USE)' ), 'Case Workgroup Assignement History (USE)'[Index] = _preindex ) )If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can update the formula of the calculated column as below:
Column_NextDate =
CALCULATE (
MAX ( 'Case Workgroup Assignement History (USE)'[Created_Date] ),
FILTER (
'Case Workgroup Assignement History (USE)',
'Case Workgroup Assignement History (USE)'[Index]
= EARLIER ( 'Case Workgroup Assignement History (USE)'[Index] ) + 1
)
)
Or you can create a meausre as below to get it:
NextDate =
VAR _selindex =
SELECTEDVALUE ( 'Case Workgroup Assignement History (USE)'[Index] )
VAR _preindex =
CALCULATE (
MIN ( 'Case Workgroup Assignement History (USE)'[Index] ),
FILTER (
ALLSELECTED ( 'Case Workgroup Assignement History (USE)' ),
'Case Workgroup Assignement History (USE)'[Index] > _selindex
)
)
RETURN
CALCULATE (
MAX ( 'Case Workgroup Assignement History (USE)'[Created_Date] ),
FILTER (
ALLSELECTED ( 'Case Workgroup Assignement History (USE)' ),
'Case Workgroup Assignement History (USE)'[Index] = _preindex
)
)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi,
Sorry for not replying sooner, this worked thank you. I actually realised the problem in my source data which was causing the issue also. Basically on my Rank column the numbering was going 1,3,4,6,7,8,9 etc because some columns were being filtered out. i removed the filter and this fixed the measures. i now need to fix my SQL query to only pull the rows i actually need.
Thank you so much