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
KatkaS
Post Patron
Post Patron

Summarize a column..

Dears,

 

I would need a help with a simple task..

I need to summarize columns - I created below measure, but I'm not able to figure our what the error is.

 

Could you please help?

Thank you..!

Summarize.png

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @KatkaS ,

 

You can sum directly in a matrix or table visual.

v-lionel-msft_0-1594863732316.png

Or create measure like.

Measure = 
CALCULATE(
    SUM(Sales[Sale 2013]),
    ALL(Sales)
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @KatkaS ,

 

You can sum directly in a matrix or table visual.

v-lionel-msft_0-1594863732316.png

Or create measure like.

Measure = 
CALCULATE(
    SUM(Sales[Sale 2013]),
    ALL(Sales)
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you very much, Lionel, it worked!

I need to create it as a measure, because I need to use it for another calculation...and I don't know how to do it otherwise.

Greg_Deckler
Super User
Super User

@KatkaS - First, you can drop the CALCULATE, it's useless. Second, SUMMARIZE is going to return a table of values. Hence, if you use it in a Measure or Column, you will get the error that you are seeing. Essentially what it is saying is that a table is being returned but that's an invalid result for a Measure/Column. Measures and Columns require that a single value be generated. Thus, one way to fix it would be this:

 

Measure = SUMX(SUMMARIZE(...),[Tax])

 

But, it is difficult to know what you are actually going for. If you put that SUMMARIZE statement as the formula for a new table, it will work. That's another way to fix it.


@ 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...

Thank you very much, Greg, for your time!

I need to devide number of services (this measure) by number of people (second measure I'm working on) - this is what I'm going for. I don't know how to do it otherwise then create two measures that would be used for third measure (M3 = M1/M2). I hope I expressed myself clearly:)

I tried your measure but it didn't work (I'm attaching the error ), I tried many different times; but don't spend more of your time, the one of lionel is working very well. 

Thank you again!

error.png

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.