cancel
Showing results for
Did you mean:
Frequent Visitor

## KPI Statuses in a Switch formula

Hi,

In PowerBIDesktop or Excel

how can you write a DAX SWITCH formula that would switch over Statuses of different KPI's. So sort of

=SWITCH( [SwitchMeasure], [StatusOoKPIOne, [StatusOfKPITwo],...)

where KPI's were imported from Excel...

So to see the icons for the selected measure...

3 REPLIES 3
Member

## Re: KPI Statuses in a Switch formula

ur requirement is quite no clear, can you be more specific?

Frequent Visitor

## Re: KPI Statuses in a Switch formula

Ok, so in a Data Model in Excel you have a bunch of measures and a bunch of KPI-s defined for those measures.

And then, instead of vasting many columns of valuable workspace, you use a disconected slicer method, so that you can easily change the calculation (so still have them all available), you wish to see and only use one column of real estate

Now with calculations this works great... My question however is, if you can write a magic SWITCH formula (or use another function) to use only one column on the KPI statuses (the icons).. Something like

but with some sort of magic dust

Member

## Re: KPI Statuses in a Switch formula

HI @ExcelUnplugged, You can indeed do this in DAX, it works in Power BI, where you defined the KPI in separate measures, and chain them together in a single switch statement, based on a table of measure names (this config is a bit manual but it works).

The Selected Measure is a Measure over a list of measures : Selected Measure = SELECTEDVALUE('Measure Table'[Measure Column])

Individual KPIs look like this:
Store Performance KPI =
IF('Availability Ratio Measures'[Store Performance] < 0.8, "0",
IF('Availability Ratio Measures'[Store Performance] < 0.9, "1",
"2")
)

Then the flexible KPI is:

Flexi KPI = SWITCH([Selected Measure],
"Store Performance", [Store Performance KPI]
) - you can include more measures and only format selected columns using your KPIs.

Announcements

#### Community Highlights

Find out what's new in the Power BI Community!

#### Power Platform Summit North America

Register by September 5 to save \$200

#### Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 240 members 2,612 guests
Recent signins: