Forum Discussion

jaryszek's avatar
jaryszek
Super User
7 months ago
Solved

Creating UDF function within TMDL view

Hello Guys,

How to make a proper syntax for this query in TMDL view for remote semantic model (DirectLake over OneLake)?

createOrReplace
  function GetBudgetHexColor = ( v: double, actionName: string ) =>
    IF (
      ISBLANK ( v ),
      BLANK (),
      MAXX (
        FILTER (
          Fmt_BudgetRules,
          Fmt_BudgetRules[IsActive] = TRUE ()
            && Fmt_BudgetRules[ConditionActionName] = actionName
            && v >= Fmt_BudgetRules[ThresholdLowerPercent]
            && v <  Fmt_BudgetRules[ThresholdUpperPercent]
        ),
        Fmt_BudgetRules[HexColor]
      )
    )


This is not working.

Best,
Jacek

  • Problem solved, compatibility level of semantic model has to be changed to 1702...

    best,
    Jacek

2 Replies

  • VijayP's avatar
    VijayP
    Community Champion

    jaryszek 

     

    When I tested udf in a remote symentic model , it is working for me. 

    need more information if any error code etc

    • jaryszek's avatar
      jaryszek
      Super User

      Problem solved, compatibility level of semantic model has to be changed to 1702...

      best,
      Jacek