How to Build a Multi-KPI Comparator Using Calculation Groups (Power BI DAX Tutorial)

As the name suggests, a multi-kpi comparator allows you to compare multiple KPIs or measures on the same chart. This way you can dramatically reduce the clutter on your Power BI report page.

You can select what measure you would like to see in bars for example and which one should go into a line. We use calculation groups to help us with dynamic formatting so that we can format each selection as $, % or whole numbers as a user makes his or her selections.

You can download the model here.

KPI Table Example:

KPIIDKPI FORMAT
SELECT KPI0
Sales1 \$#,0;(\$#,0);\$#,0
Units2#,0
Margin3 \$#,0;(\$#,0);\$#,0
Margin %4#,0.0%;-#,0.0%;#,0.0%
KPI1 = 
SWITCH(
    SELECTEDVALUE(KPI1[ID]),
    0, BLANK(),
    1, [Sales],
    2, [Units],
    3, [Margin],
    4, [Margin %]
)
Dynamic formatting Calculation Group example:

SWITCH(
    SELECTEDMEASURENAME(),
    "KPI1", SELECTEDVALUE('KPI1'[KPI FORMAT]),
    "KPI2", SELECTEDVALUE('KPI2'[KPI FORMAT]),
    SELECTEDMEASUREFORMATSTRING()
)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s