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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ngin92
Frequent Visitor

Not understanding how to add group by columns to SUMMARIZECOLUMNS

Hello,

 

I'm currently trying to recreate a data set that I had set up using MySQL in another BI solution as a new table in DAX in PowerBI.  I was able to set up the following (DAX.1) without any filtering capabilities based on the SQL but I'm having a lot of trouble figuring out how to incorporate my desired categorical columns into this table.  The goal here is to get total cases opened and closed by day with the ability to add filters by the Support Tier and Case Type.  I'll then add measures to calculate a total case balance (Cases Opened - Cases Closed) and total ending backlog value by day.

 

DAX.1: Working table with no categories

 

CaseInOut = 
        FILTER(ADDCOLUMNS(
                SUMMARIZE('Created Date Dimensions','Created Date Dimensions'[Date]),
                "Cases Opened",
                        SUMX('Cases',
                                IF(AND('Cases'[CreatedDate - Date Only].[Date] >= 'Created Date Dimensions'[Date],'Cases'[CreatedDate - Date Only].[Date] < DATEADD('Created Date Dimensions'[Date],1,DAY))
                                ,1,0)),
                "Cases Closed",
                        SUMX('Cases',
                                IF(AND('Cases'[ClosedDate - Date Only].[Date] >= 'Created Date Dimensions'[Date],'Cases'[ClosedDate - Date Only].[Date] < DATEADD('Created Date Dimensions'[Date],1,DAY))
                                ,1,0))
                ), AND('Created Date Dimensions'[Date] < TODAY(),'Created Date Dimensions'[Date] > MIN('Cases'[CreatedDate - Date Only].[Date])))

I'm trying to group this data by the following two columns: 'Cases'[Support Tier], 'Cases'[Type]

 

 

 

DAX.2: Attempt to use SUMMARIZE that is not working as expected

CaseInOut2 = 
FILTER(
SUMMARIZECOLUMNS(
'Created Date Dimensions'[Date],
'Cases'[Support Tier],
'Cases'[Type],
"Cases Opened",
SUMX('Cases',
IF(AND('Cases'[CreatedDate - Date Only].[Date] >= 'Cases'[CreatedDate - Date Only],'Cases'[CreatedDate - Date Only].[Date] < DATEADD('Created Date Dimensions'[Date],1,DAY))
,1,0)),
"Cases Closed",
SUMX('Cases',
IF(AND('Cases'[ClosedDate - Date Only].[Date] >= 'Cases'[CreatedDate - Date Only],'Cases'[ClosedDate - Date Only].[Date] < DATEADD('Created Date Dimensions'[Date],1,DAY))
,1,0))),
AND('Created Date Dimensions'[Date] < TODAY(),'Created Date Dimensions'[Date] > MIN('Cases'[CreatedDate - Date Only].[Date])))

 

I'm pretty new to DAX so I'm not sure if what I have currently is actually very efficient, any suggestions would be greatly appreciated.

 

Desired end result is to have a chart like this which can be filtered by Tier and Type:


2018-03-30_12-48-09.png

 

 

 

1 REPLY 1
Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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