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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
MicrobicTiger
New Member

Generate a table which combines summarised data from multiple tables.

Hi, I am new to Power Bi and am trying to generate a table that combines summarised data from multiple tables.

New Table= ADDCOLUMNS(
    UNION(
        SUMMARIZE(
            FILTER(
                'Purchased',
                'Purchased'[Units] > 1
            ),
            'Purchased'[Account],
            "Total Units", SUM('Purchased'[Units])
        ),
        SUMMARIZE( 
            FILTER(
                'Users',
                'Users'[Start Time].[MonthNo] = EOMONTH(TODAY(), -1)
            ),
        'Users'[Account],
        "Last Month", COUNT('Users'[Name])
        )
    ),
    "Last Month", COUNT('Users'[Name])
)

The result gives me a count of units by account, but each row is the total of Users.

| Account | Total Units | Last Month |
|:-------:|:-----------:|:----------:|
|Name 1 | 12 | 8000 |
|Name 2 | 63 | 8000 |
|Name 4 | 42 | 8000 |

How do I get the summarised result in my Last Month field?

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @MicrobicTiger 

 

Do you want to summarize Total Units from 'Purchased' table into "Total Units" column, and summarize Last Month User Count from 'Users' table into "Last Month" column? If so, you don't need to use UNION function.

 

In addition, what does 'Users'[Start Time].[MonthNo] return? If it returns a month number, it cannot be compared to EOMONTH(TODAY(), -1) because the latter one returns the last date of last month.

 

Based on above, the expected result of user count summarization from 'Users' table is not very clear. Can you please provide some sample data as well as the expected result in table format?

 

Besides, assume the 'Users' table is like below,

vjingzhang_0-1675219459583.png

you can try 

New Table = 
ADDCOLUMNS (
    SUMMARIZE (
        FILTER ( 'Purchased', 'Purchased'[Units] > 1 ),
        'Purchased'[Account],
        "Total Units", SUM ( 'Purchased'[Units] )
    ),
    "Last Month",
        COUNTX (
            FILTER (
                'Users',
                'Users'[Account] = EARLIER ( 'Purchased'[Account] )
                    && 'Users'[Start Time] = EOMONTH ( TODAY (), -1 )
            ),
            'Users'[Name]
        )
)

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.