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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
TDE_Dragan
Regular Visitor

Problem with aggegate values

Hi all,

I am new to DAX, comming with SQL Server background.
My data is organized in a classic way, two tables:
- Companies, with columns company_id, country and name;

- Impressions, with impression_id, click_id, company_id and timestamp.
The problem I have is with some aggregated values, I can create them as calculated columns on Companies table or as whole new table - however this way allows only filtering on Companies[Country] and I absolutely need to filter on Impressions[timestamp].

Can you please suggest how to modify my DAX?

ADDCOLUMNS (
    SUMMARIZE (
        Impressions;
        Impressions[target_company_id];
        "TotalImpressions"; SUMX ( Impressions; IF ( Impressions[impression_id] > 0; 1 ) );
        "TotalClicks"; SUMX ( Impressions; IF ( Impressions[click_id] > 0; 1 ) )
    );
    "Company Name"; LOOKUPVALUE (
        Companies[Company Name];
        Companies[id]; Impressions[target_company_id]
    )
)


Thanks!

0 REPLIES 0

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.