Forum Discussion

sudheerbolla's avatar
sudheerbolla
Helper II
3 years ago

Need Help in fixing the Date Issue

Created PolicyEndDate calculated column  by following DAX function

 

PolicyEndDate = Var _PolicyNo = MAX(Consolidated[POLICY_NUMBER (Imported)])
Return
IF(
    OR(
        Consolidated[EVENT_CODE (Imported)]="cancel_policy",
        Consolidated[EVENT_CODE (Imported)]="cancel_policy_non_payment"
    ),
MAXX(FILTER(ALL(Consolidated),Consolidated[POLICY_NUMBER (Imported)]=_PolicyNo),Consolidated[Crediting Date]),
BLANK()
)
 
Created 

when i drag and drop the PolicyEndDate column in the canvas area, it is showing as below

I want only in date format like 4/21/2023 instead of Herirachy. How to resolve this. Please let me know. Thank you


 

2 Replies

  • You'll need to right-click on PolicyEndDate in the visual and select the non-date heirarchy option

     

  • Used selectedvalue(), this has solved the problem. on right-click on PolicyEndDate in the visual and select the non-date heirarchy option is not found.
     
    PolicyEndDate1 = Var _PolicyNo = SELECTEDVALUE(Consolidated[POLICY_NUMBER (Imported)])
    Return
    IF(
        OR(
            SELECTEDVALUE(Consolidated[EVENT_CODE (Imported)])="cancel_policy",
            SELECTEDVALUE(Consolidated[EVENT_CODE (Imported)])="cancel_policy_non_payment"
        ),
    MAXX(FILTER(ALL(Consolidated),Consolidated[POLICY_NUMBER (Imported)]=_PolicyNo),Consolidated[Crediting Date]),
    BLANK()
    )