John Liu Blog

Every drop counts

Power BI Auto Select KPI using Field Parameter

(Note: at time of this post, both Field parameters and New card visual are still in preview. To use these two functions, go to File –> Options and settings –> Options –> Previw features, and turn on these features.) You might need to develop Power BI KPI report for different department/user with same visual format but different data. For example, a report with some card visual and line chart for different but targeting different KPI measures.

Power BI Page Navigation

For page navigation button, we can’t set icon as with normal button. However, if we add the icon as part of the page name, the button will show on the navigation button. To add an icon to the page name, hold Windows logo key + period (.) key. This will open the emoji window for you to pick an emoji icon. Apart from the Window emoji, you may find icons from unicode-table or vertex42

Power BI Smart Axis

When developing Power BI report with date slicer, the large date range might make the visual overwhelming if the X axis interval is on a fix date/week/month/quater interval. It would be helpful if the X axis can auto adjust the interval betwee date/week/month/quater/year. Assumed you have a date table dimDate in your report. We can add another AutoPeriod table (in Model View –> click on New table) to define the possible intervals for the axis:

Azure Cosmos DB study notes

TTL (time-to-live): max 2,147,483,647seconds (~68years) For TTL to work at either container or item level, it needs to be enable/configured at container level first. If only configured at item level, it will be ignored unless TTL is enabled/configured at container level default TTL is not configured max configureable TTL is ? Previsioned throughput vs. serverless: previsioned throughput is ideal for predictable traffic patterns that require sustained and predictable performance with minimal variance Serverless can handle wildly varying traffic and low average-to-peak traffic ratios

Azure SQL DB call external API

With the introducing of sp_invoke_external_rest_endpoint in Azure SQL DB, it’s possible to directly calling the Azure OpenAI service within the database. Azure OpenAI is in the safe-listed Azure services. For other API service (like common OpenAI) that’s not in the safe-list, you will need to create a wrapper API in the Azure API Management Instance. To invoke external rest endpoint in Azure SQL DB, a few setup steps are required: