Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Create summarize table with if statement

Hello everyone,

I'm creating a scorecard with two main features.  The first is a table with overall KPIs.  This has been straight forward to create.

What I would like to do is populate a table with 3 columns (description, measure, and value) that is populated from different data sources based on the main KPI the user selects.

For example if they click on the COF (Customer Order Fulfillment) KPI, the detailed table will show # of cut cases by material, brand, and customer from the COF data source.  But if they select DPA (Demand Planning Accuracy) KPI that the detailed table will show biggest change in cases by warehouse and business from the DPA data source.

 

My idea was to create a summarized table with 3 standard columns: description, measure, and value that uses an if statement to populate the table based on the selected KPI measure.  However I get a multiple column error.

 

error1.PNG

 

Ultimately, this is what I'm trying to create, where the user can click on a KPI on the top and they get a detailed view below on a table that pulls from a different data source based on what's selected.

 

error 2.PNG

Let me know what recommendation you have to populate a table from various data sources determined by a selected value.

 

Thanks for your help

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Anonymous ,

>>However I get a multiple column error.

Unfortunately, power bi not support this.

AFAIK, if statement not support to return table or multiple columns as expressions result. In addition, Power bi not support to create dynamic calculated column/table based on filter/slicer.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
Gustavo_77
Regular Visitor

One approach to this can be to pre-populate all results into one table via UNION with Summarize in it. Shortened version to illustrate syntax. From this dataset, you can filter by the custom column "MeasureType"

ResponseUnion = UNION(
                SUMMARIZE('COF Mat','COF Mat'[Business], "MeasureType", "COF"),
                SUMMARIZE('Data: DPA', 'BusinessKey'[Business], "MeasureType", "DPA")
            )

 

v-shex-msft
Community Support
Community Support

HI @Anonymous ,

>>However I get a multiple column error.

Unfortunately, power bi not support this.

AFAIK, if statement not support to return table or multiple columns as expressions result. In addition, Power bi not support to create dynamic calculated column/table based on filter/slicer.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Good to know.  The best work around I can think of is to use the button-bookmark approach where I stack a bunch of detailed tables on top of each other and only display the one based on the button they select.

 

Not as elegant of a solution than what I wanted but it's the best I can do.

Anonymous
Not applicable

Did you end up coming up with a solution? I am facing this right now.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.