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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Sub
Regular Visitor

How do I get this expression to work?

I have no idea if this is the correct place for placing this question. If it's not, please, feel free to change it. It concerns the following expression:

 

Meldingen =
SUMMARIZE
(
    'powerbi vgb_melding';
    'powerbi vgb_melding'[aanvangdatum];
    "Meldingen"; SUM('powerbi vgb_melding'[aangemaaktid] ))

 

What I want to do is, to read the amount of meldingen (tickets) and place them neatly in columns with the corresponding date. Example (if i'm being vague about things):

 

Date:                                    Tickets:

October 23, 2016                17 tickets

October 24, 2016                9 tickets

 

But if I execute the expression it gives me the following error: "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

 

I already tried to troubleshoot it, but with no luck. What am I doing wrong? Forgive me if it's a typo, but this is the first time I work with DAX and  my experience with MySQL is not much either.

 

Thanks in advance

1 ACCEPTED SOLUTION

Hi @Sub,

 

I think you forget to write the measure name, right?

 

Sample:

 

Column/Measure Name= SUMX(SUMMARIZE
(
    'powerbi vgb_melding';
    'powerbi vgb_melding'[aanvangdatum];
    "Meldingen"; SUM('powerbi vgb_melding'[aangemaaktid] )
),[Meldingen])

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

5 REPLIES 5
Sub
Regular Visitor

Hello v-shex-msft,

 

Thanks for the suggestion, but when I use your function it returns an error: "To use special characters in a measure name, enclose the entire name in brackets ( [] ) and add a ] to any closing brackets in the name." I've looked everywhere, but the brackets are there and none are missing as it seems.

Hi @Sub,

 

I think you forget to write the measure name, right?

 

Sample:

 

Column/Measure Name= SUMX(SUMMARIZE
(
    'powerbi vgb_melding';
    'powerbi vgb_melding'[aanvangdatum];
    "Meldingen"; SUM('powerbi vgb_melding'[aangemaaktid] )
),[Meldingen])

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi,

 

I think you're right. 😕

 

Anyway, it works now. Thanks! Will mark your answer as the accepted answer.

v-shex-msft
Community Support
Community Support

Hi @Sub,

 

As smoupre said, SUMMARIZE function will return a table, you need to use a new table to receive the result, you can't direct use in calculate column/measure.

If you want to use there formula in measure and column, you need to use other functions to convert the result to value.

 

For e.g: SUMX, COUNTROWS...

SUMX(SUMMARIZE
(
    'powerbi vgb_melding';
    'powerbi vgb_melding'[aanvangdatum];
    "Meldingen"; SUM('powerbi vgb_melding'[aangemaaktid] )
),[Meldingen])

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Greg_Deckler
Super User
Super User

Are you creating a table because SUMMARIZE will return a table. If you are trying to create a measure with that formula it will fail because you are trying to shove a table into a scalar.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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