Forum Discussion

rampie's avatar
rampie
Kudo Commander
9 months ago
Solved

UDF With Time Int or Relationship functions

Has anyone try combining UDF with Time Intelligence or Relationship functions the results of these UDF it's the same value than the original measure, i don't see any limitations in the UDF documentation

 

For Example: 

 

UDF_Calcultate_LY_StoreCart = (
        MeasureName : decimal
     ) => CALCULATE( MeasureName, USERELATIONSHIP( Dim_Date[LYDate], Dbo_StoreCart[OrderDate] ))
 
or
 
UDF_Calcultate_YTD = (
        MeasureName : decimal
     ) => TOTALYTD( MeasureName, Dim_Date[Date] )
  • rampie it should be something like this:

     

    UDF_Calcultate_LY_StoreCart = (
            MeasureName : EXPR
         ) => CALCULATE( MeasureName, USERELATIONSHIP( Dim_Date[LYDate], Dbo_StoreCart[OrderDate] ))

3 Replies

  • rampie it should be something like this:

     

    UDF_Calcultate_LY_StoreCart = (
            MeasureName : EXPR
         ) => CALCULATE( MeasureName, USERELATIONSHIP( Dim_Date[LYDate], Dbo_StoreCart[OrderDate] ))