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
Anonymous
Not applicable

Multiple Summarize functions in the same create table code.

Hi, is it possible to use multiple summarize function in one create table dax when creating a new table?

I tried to do a create table with dax and put in multiple Summarize functions, with different filters for each one.  
In the code I had it set so depending on certain criteria, it would only call the Summarize function that matched my criteria.

It wouldn't allow me to do that.

So, I it possible to have a create table script using multiple Summarize/Filter options?

2 REPLIES 2
Anonymous
Not applicable

can you post the calculatetable code in this post?

Anonymous
Not applicable

The reason I tried this was because for some reason, the _Selstart and _SelEnd variables were literally ignoring whatever was in the table; so when i used MIN('Satisfaction'[MetricDate]) and MAX('Satisfaction'[MetricDate]) to attempt to get the earliest and latest dates, it wouldn't pick up the dates (despite checking and confirming that the dates existed. 
It is as if no matter what I use in those _SelStart and _Selend Functions to capture the date, it was completely ignored, unless I added a specific date into each one.

Referrer excel Summary1 =
// This is the recent one, the Summary 2 is the next one.
//Slicer Selection
VAR _SEL = SELECTEDVALUE('_CalendarSlicer'[Period])

//--------------------------------------------------------
VAR _SelStart = SWITCH(_SEL,
    "Everything",MIN('Satisfaction'[MetricDate]),
    "Last Month",MIN('Satisfaction'[MetricDate]),
    "Last Year", MIN('Satisfaction'[MetricDate]),
    "This Month",MIN('Satisfaction'[MetricDate]),
    "This Year", MIN('Satisfaction'[MetricDate]),
    "Year before last",MIN('Satisfaction'[MetricDate])
    )

VAR _SelEnd = SWITCH(_SEL,
    "Everything",MAX('Satisfaction'[MetricDate]),
    "Last Month",MAX('Satisfaction'[MetricDate]),
    "Last Year", MAX('Satisfaction'[MetricDate]),
    "This Month",MAX('Satisfaction'[MetricDate]),
    "This Year", MAX('Satisfaction'[MetricDate]),
    "Year before last",MAX('Satisfaction'[MetricDate])
    )

--------------------------------------------------------------------------
VAR _SummaryTable1 = SUMMARIZE (
    FILTER (
        'Referrer Excel',
        'Referrer Excel'[Date] >= _SelStart && 'Referrer Excel'[Date] <= _SelEnd
    ),
    'Referrer Excel'[Referrer Type],
    "Total Count", Count('Referrer Excel'[Referrer Type No])
)


RETURN _SummaryTable1

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.