Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I am trying to build a report that display the measure dax code that i have written in other reports. I am able to get the text of the measure expressions from a power bi template file. What i am looking for is to see if there is any custom visual that can display the dax measures in a good looking format?
Till now i am visualizing the measure's text in a column in a table visual, but it is so difficult to read.
you can call the DAXFormatter.com API.
Thanks for your reply,
can you please elaborate a little bit more?
What i understood is that you are suggesting that i call the Daxformatter api, to generate a new formatted column out of my raw dax measure, right?
Trying to invoke that column but getting the following error:
You seem to be trying to do this in Power Query? Is that where your DAX queries are stored?
This is what the general process would look like. NOTE: Check the API usage conditions before proceeding!
let
Source = #table({"Raw"},{{"Show =
var m = max(Dates[Date])
var d = CALCULATE(max('Table'[Transaction Date]),ALLEXCEPT('Table','Table'[Customerid]),'Table'[Transaction Date]<=m && 'Table'[Transaction Date]>= EDATE(m,-3))
return if (SELECTEDVALUE('Table'[Transaction Date])=d,1,0)"}}),
#"Added Custom" = Table.AddColumn(Source, "Link", each "https://www.daxformatter.com/?embed=1&fx=" & Uri.EscapeDataString([Raw])),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Result", each Web.BrowserContents([Link],[WaitFor = [Selector = "div.result"]])),
#"Split Column by Delimiter" = Table.SplitColumn(#"Added Custom1", "Result", Splitter.SplitTextByEachDelimiter({"<div class=""result"">"}, QuoteStyle.None, false), {"Result.1", "Result.2"}),
#"Split Column by Delimiter1" = Table.SplitColumn(#"Split Column by Delimiter", "Result.2", Splitter.SplitTextByEachDelimiter({"</div"}, QuoteStyle.Csv, false), {"Formatted HTML", "Result.2.2"}),
#"Removed Other Columns" = Table.SelectColumns(#"Split Column by Delimiter1",{"Raw", "Formatted HTML"})
in
#"Removed Other Columns"
and then displayed in a HTML5 viewer visual: