cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Helper III

## Create a summary table using DAX

Hi,

I have a requirement to create a summary table based on three other tables.

Please find sample data below

Table1:

Table2:

Table3:

Expected Outut:
Create a summary table with the counts from each table as below:

I have also attached a sample pbix file here.

Thank you.

1 ACCEPTED SOLUTION
Community Support

Hi @POSPOS ,

The calculated table is static, here's the formula:

``````Table 2 = var _table={"Stage1","Stage2","Stage3"}

If you want the dynamic counting result, you should create a table with three stages. And put a measure into the table visual. Because measures are dynamic.

Here're the steps.

1.Table with three stages. You can also create it by entering data.

2.Create a measure.

``Measure = SWITCH(MAX('Table 3'[Value]),"Stage1",[Stage1_Count],"Stage2",[Stage2_Count],"Stage3",[Stage3_Count])``

3.Here's the result.

Best Regards,

Stephen Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Community Support

Hi @POSPOS ,

The calculated table is static, here's the formula:

``````Table 2 = var _table={"Stage1","Stage2","Stage3"}

If you want the dynamic counting result, you should create a table with three stages. And put a measure into the table visual. Because measures are dynamic.

Here're the steps.

1.Table with three stages. You can also create it by entering data.

2.Create a measure.

``Measure = SWITCH(MAX('Table 3'[Value]),"Stage1",[Stage1_Count],"Stage2",[Stage2_Count],"Stage3",[Stage3_Count])``

3.Here's the result.

Best Regards,

Stephen Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Resolver IV

Hi @POSPOS

I have a solution that may or may not work for your exact use case.

First I create a blank table with two columns, "Steps" and "Sum of Count". No rows. I called this table "Solution Table".

Then I create a DAX Table as below:

``````Solution =

UNION('Solution Table',
ROW(
"Steps", "Stage1"
,"Sum of Count", Stage1[Stage1_Count]
),
ROW(
"Steps", "Stage2"
,"Sum of Count", Stage2[Stage2_Count]
),
ROW(
"Steps", "Stage3"
,"Sum of Count", Stage3[Stage3_Count]
)
)``````

And the result of this "Solution" will match the result your expected outcome. However, if you start intrducing filters in your report that affect the 3 original measures in the 3 Stage tables, then the summary table will not update automatically. I am afraid I do not have a solution where the summary table would be affected by slicers or filters dynamically.
I hope this helps!

Helper III

@dk_dk  - Thank you for the response. But we do have other visuals/slicers in the report and the users would expect the visuals to be interactive.
Eg: Selecting a protocol in the slicer and the "Solution" table should be filtered out to see in which step that protocol is in.
Trying to find out if we have any solution to have the visual interactive.

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors