Search code examples
powerbireportanalytics

Dynamic Card Labeling


IMPORTANT DISCLAIMER: I am a newbie at Power BI, so please bare with me if the question sounds like something a simpleton would ask. I have attempted research, without success.

I have a PowerBI dashboard which will be drilled-down into the active dataset.

On this dashboard, I'd like to have a dynamic Card showing summary information based on the data which is drilled into.


For the purpose of this question, assume the following is the dashboard being worked on (sensitive information redacted):

PowerBI ODV Dashboard

Information about Dashboard:

The data-set is a complete unfiltered order book with line items for each order (so duplicate order number values exist). A page-wide filter is applied to filter out certain order types (OR Type == 'OP','OS'). A further important filter is added to this page, based on a measurement determining the delta of each order item's Qty Committed vs Qty Received. The measurement allocates the answer to diff which is renamed to "Difference".


The Requirement:

For this report, I need the cards to update dynamically based on table and filter values.

Requirement 1:

Card 1 shows the Branch name. This works perfect when a Branch Filter is applied; however, as the Card's data is set to show the first entry in the data-set, when all records of field Branch is selected, I would like to display "All Branches" instead of the first entry. I am uncertain about how to go about achieving this.

In short: If Filters = [Select All], then show [Branch / Plant] card as "All Branches", otherwise show selected [Branch / Plant].

Requirement 2:

Card 2 shows the total number of Orders, and not the amount of Open Orders, where diff > 0. The card should thus be showing the value of Open Orders shown in the screenshot's table [OPEN ORDERS PER VENDOR], which should be 139. The value of 207 currently displayed, is the total number of orders, and the diff > 0 filter is ignored.

What I've tried for Requirement 2, is as follows:

  • I have tried adding the measurement diff as a filter to the card, but cannot change the Filter parameters. Failed Filter Parameters
  • I have tried creating a new field column, with the measurement for the column being Outstanding = SUM('Purchase Order Report'[QuantityCommitted]) - SUM('Purchase Order Report'[QuantityReceived]). This is the same measurement to derive diff. I added the new field column as a filter, which then allowed me to change the parameters, but made no difference. What I have also noticed, was that, even though the formulas were identical, the values of Outstanding did not match the values of diff, which I recon that outstanding was ignoring all filters, and simply took the values of the raw data-set.

Any guidance will be appreciated! If I have left out important information which is required to contribute to this question, please tell me in the comments, so that I can add it.


Solution

  • For requirement 1, I always use the if(isfiltered function in DAX. Just create a measure with the following DAX: IF(ISFILTERED([Branch / Plant]),CONCATENATEX(filters([Branch / Plant]),[Branch / Plant]," , "),"ALL"))

    To explain: ISFILTERED checks if the filters are applied. If it is true, it will concatenate the strings with a comma. If it is fals, it will show "ALL"

    Also quick measures could be helpfull to set this up. If you create a new quick measure, totaly at the bottom you will have a calculation called concatenated list of values.

    Br

    Chris