最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

powerbi - Why is XMLA code showing error on '<'? < and <![CDATA[ are also not working -

programmeradmin2浏览0评论

I am creating partitions on a Power BI DirectQuery table. I am trying to do this using M code in XMLA endpoint using SSMS. Here is the code I am trying to write:

"partitions": [
{
"name": "Operating Metric Rank Import Partition",
"mode": "import",
"source": {
"type": "m",
"expression": [
"let",
"    Source = Sql.Database(Server, Database, [Query=\"SELECT pk_fact_rank_operating_metric_union.*,pk_dim_acct_period.ending_date#(lf)FROM pk_fact_rank_operating_metric_union#(lf)inner join pk_dim_acct_period#(lf)on pk_fact_rank_operating_metric_union.acct_period_key = pk_dim_acct_period.acct_period_key\"])",
"    #\"Filtered Rows\" = Table.SelectRows(Source, each Date.IsInPreviousNYears([ending_date], 1)) ",
"in",
"   #\"Filtered Rows\""
]
}
},
{
"name": "Operating Metric Rank DQ Partition",
"mode": "directQuery",
"source": {
"type": "m",
"expression": [
"let",
"    Source = Sql.Database(Server, Database, [Query=\"SELECT pk_fact_rank_operating_metric_union.*,pk_dim_acct_period.ending_date#(lf)FROM pk_fact_rank_operating_metric_union#(lf)inner join pk_dim_acct_period#(lf)on pk_fact_rank_operating_metric_union.acct_period_key = pk_dim_acct_period.acct_period_key\"])",
"    #\"Before One Year Ago\" = Table.SelectRows(Source, each [ending_date] <  Date.IsInPreviousNYears([ending_date], 1)) ",
                    "in",
                    "    #\"Before One Year Ago\""
                  ]
                }
              }
            ]

The error I am getting at '<': Illegal syntax. Expecting valid start name character. When I try to use "<" I get: Invalid token '<' at root level of document. I also tried to use <![CDATA[ but the error says: Invalid token '(All M Code)' at root level document. What can be the solution here? Thank you!

发布评论

评论列表(0)

  1. 暂无评论