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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Ormy28
New Member

Add New Columns to Summary Table

Hi

 

I'm quite new to DAX, so there might be a straightforward solution to this.

 

I have a table of data as below, with dates and a colour.

IDWeek StartColour
107/04/2025Red
207/04/2025Red
307/04/2025Red
407/04/2025Blue
507/04/2025Green
614/04/2025Red
714/04/2025Red
814/04/2025Blue
914/04/2025Blue

 

I have created a summary table SUMMARIZE that would return the below:

Week StartREDBLUEGREEN
07/04/2025311
14/04/2025220

 

This is how I did this:

SUMMARIZE('Table1', 'Table1'[Start of Week],

"RED", CALCULATE(COUNT('Table1'[Colour]), FILTER('Table1', [Colour] = "Red")),

"BLUE", CALCULATE(COUNT('Table1'[Colour]), FILTER('Table1', [Colour] = "Blue")),

"GREEN", CALCULATE(COUNT('Table1'[Colour]), FILTER('Table1', [Colour] = "Green"))

)

 

However, a new colour could appear in the future. Therefore, if Yellow was to appear in week starting 21/04/2025, I would need to amend the above DAX to pick up this new colour.

 

Is there any way to create a summary table that would list all colours for a particular date, along with the associated count, without having to amend the DAX when they appear? I might be heading down the wrong avenue using SUMMARIZE and there is a more efficient way of doing this. Any help would be greatly apreciated.

 

Thanks.

 

 

1 ACCEPTED SOLUTION
PijushRoy
Super User
Super User

Hi @Ormy28 

Plase use below DAX 

DynamicSummary =
SUMMARIZE(
    'Table', 
    'Table'[Week Start], 
    'Table'[Colour],
    "Count", COUNT('Table'[ID])
)

 

PijushRoy_0-1744633308822.png

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





View solution in original post

2 REPLIES 2
PijushRoy
Super User
Super User

Hi @Ormy28 

Plase use below DAX 

DynamicSummary =
SUMMARIZE(
    'Table', 
    'Table'[Week Start], 
    'Table'[Colour],
    "Count", COUNT('Table'[ID])
)

 

PijushRoy_0-1744633308822.png

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Excellent, thanks for the help. A straightforward and logical solution.

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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