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
LBarto90
Regular Visitor

Summarize a measure

Hey Folks,

 

I have a problem with a data table and cant figure out the problem. It would help me a lot if you have an idea on this issue.

 

There is a data table like this

Namedatevalue
a2023-10-201
b2023-10-201
a2023-10-211
a2023-10-221
a2023-10-221

 

he value in the value Column is always 1, the values in the other rows can be different.

 

In this example the result for "a" = 4, "b" = 1

 

For my Visualition I need a table which looks like this:

 

CategorySum
1-3 days1
4-10 day1

 

I ve managed to create a measure which shows me the category text ("1-3 days", "4-10 days") if I combine it with the "Name" column. But I cant summarize just the Category column.

 

Is there any way to solve this?

 

Greetings

Rico

 

 

 

4 REPLIES 4
LBarto90
Regular Visitor

Spoiler
@Greg_Deckler 
If you need further information pls let me know.
LBarto90
Regular Visitor

"Category" is not a colomn in the data table. "Category" is the value which is Calculated from the measure. So I guess this wont work.

This is the DAX of the measure:

 

Anzahl krank_Kategorie =
SWITCH(
    TRUE(),
    [Anzahl krank] <= 3, "bis 3 Tage",
    AND([Anzahl krank] > 3, [Anzahl krank] <= 14), "4 bis 14 Tage",
    "0"
)
 

I need this for an absence overview. I want to know how many absence days have been totally spent in the 1-3 days range, 4-10 days range and so on.

@LBarto90 OK, try this then:

Measure = 
  VAR __Category = [Anzahl krank_Kategorie]
  VAR __Table = SUMMARIZE('Table', [Name], "__Count", COUNTROWS('Table'))
  VAR __One2Three = COUNTROWS(FILTER(__Table, [__Count]<4))
  VAR __MoreThan4 = COUNTROWS(FILTER(__Table, [__Count]>3))
  VAR __Result = IF(__Category = "1-3", __One2Three, __MoreThan4)
RETURN
  __Result


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@LBarto90 If I am understanding correctly, perhaps something like this:

Measure = 
  VAR __Category = MAX('CategoriesTable'[Category])
  VAR __Table = SUMMARIZE('Table', [Name], "__Count", COUNTROWS('Table'))
  VAR __One2Three = COUNTROWS(FILTER(__Table, [__Count]<4))
  VAR __MoreThan4 = COUNTROWS(FILTER(__Table, [__Count]>3))
  VAR __Result = IF(__Category = "1-3", __One2Three, __MoreThan4)
RETURN
  __Result


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.