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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
lboldrino
Resolver I
Resolver I

Union between two SUMMARIZE -> RETURN SELECTCOLUMNS (SUM) ???

Hi. Hier is my dax for my SUMMARIZE -table: 

Customer_TotalTickets =
VAR mytable =
Union
( filter(filter(filter(filter(SUMMARIZE (
Tickets,Tickets[Close Time].[Year],Tickets[Closed Month],Tickets[Closure],Tickets[Time Spend AG],Tickets[IM Time Spend RecordAG],Tickets[Accounting Information],Tickets[BW Comment]
,"TicketsAnzahl", DISTINCTCOUNT(Tickets[Incident ID])),Tickets[Closure]="Normal"),Tickets[IM Time Spend RecordAG] in {"ICS420AS - Customer SAP BW"}),Tickets[Time Spend AG] in {"ICS420AS - Customer SAP BW"
}),Tickets[Accounting Information]="Standard")
,
filter(filter(filter(filter(SUMMARIZE (
Tickets,Tickets[Close Time].[Year],Tickets[Closed Month],Tickets[Closure],Tickets[Time Spend AG],Tickets[IM Time Spend RecordAG],Tickets[Accounting Information],Tickets[FI Comment]
, "TicketsAnzahl",DISTINCTCOUNT(Tickets[Incident ID])),Tickets[Closure]="Normal"),Tickets[IM Time Spend RecordAG] in {"ICS420AS - Customer SAP FI/CO"
}),Tickets[Time Spend AG] in {
"ICS420AS - Customer SAP FI/CO"
}),Tickets[Accounting Information]="Standard")

)
RETURN
SELECTCOLUMNS (
mytable,
"ClosedYear", [Close Time].[Year],
"Closed Month", [Closed Month],
"IM Time Spend RecordAG", [IM Time Spend RecordAG]
,"Time Spend AG",[Time Spend AG]
,"TotalTickets",[TicketsAnzahl]
,"Comment",[BW Comment]
) )

 

The Result :

Closed MonthTotalPreisClosedYearTotalTicketsIM Time Spend RecordAGTime Spend AGComment
2019.01 201916customer SAP FI/CO FI/COFI + Finance
2019.0150811,32019306customer SAP FI/CO FI/CO FI
2019.01 201914customer BWBW BW +FI
2019.01 201992customer BWBW BW

 

But i will to calcute totaltickets over IM Time Spend RecordAG

the result must to be: 

Closed MonthTotalPreisClosedYearTotalTicketsIM Time Spend RecordAGTime Spend AGComment
2019.01 2019306 + 16customer SAP FI/CO FI/COFI + Finance
2019.01 201992 + 14customer BWBW BW +FI

 

any Idea???

ThnX fpr Your Answers 🙂

1 REPLY 1
dedelman_clng
Community Champion
Community Champion

Hi @lboldrino -

 

UNION will not sum anything. Also, you have 2 different values for [BW Comment], so you're going to get a row for each in your SUMMARIZE result.

 

By putting a MAX on [BW Comment] and [FI Comment] you should get the summary you want.

 

Also note - doing that many nested filters is going to be painfully slow as your dataset gets larger.  Look into CALCULATETABLE or us the AND() or && construct with a single FILTER command. You also may find that doing the FILTER result as the first argument in SUMMARIZE works even better.

 

var myTab2 =           
UNION (
SUMMARIZE (
 FILTER (Tickets,
   Tickets[Closure] = "Normal" &&
   Tickets[IM Time Spend RecordAG] IN { "ICS420AS - Customer SAP FI/CO" } &&
   Tickets[Time Spend AG] IN { "ICS420AS - Customer SAP FI/CO" } &&
   Tickets[Accounting Information] = "Standard"), 
 Tickets[Close Time].[Year],
 Tickets[Closed Month],
 Tickets[Closure],
 Tickets[Time Spend AG],
 Tickets[IM Time Spend RecordAG],
 Tickets[Accounting Information],
 "Comment", MAX(Tickets[FI Comment]),
 "TicketsAnzahl", DISTINCTCOUNT ( Tickets[Incident ID] )
), 
etc

 

Hope this helps

David

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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