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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
PeterG1
Frequent Visitor

syntax error

 

Hi, yes i am a newby

i try to enter this measure, but it fails with Syntax error

Any idea why?

 

syntax-error.PNG

 

 

t1 = ADDCOLUMNS(SUMMARIZE(Statement;Statement[Category];"[nb]";SUM(Statement[Amount])))

 

 

6 REPLIES 6
BhaveshPatel
Community Champion
Community Champion

This is a DAX Query Syntax and you can use this type of Syntax in DAX Studio.

 

To see the results of your syntax, you can connect your data model to DAX Studio and use Evaluate at the start of the syntax to see the results.

 

Please let us know what are you trying to achieve in brief details with sample data file.

 

Thanks & Regards,

Bhavesh

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Hi Bhavesh, this is what I want to do:

 

table:

color       amount     date

red         100            1-1-2016

red         200            1-2-2016

red         300            2-2-2016

red         400            2-2-2016

green     200           1-1-2016

green     400           1-2-2016

green    100            1-2-2016

 

 

Outcome should be in PowerBI: matrix format

 

           1-1-2016     1-2-2016   2-2-2016

red      100                200          700

green  200                500           0

 

 

thanks for your quick help

Peter

Hi Peter

 

Please see the attached screenshot for reference. No calculations are required and use matrix visual for your solution.

 

s1.PNG

 

Thanks & Regards,

Bhavesh

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

That worked indeed. 

Can I also subtract the values in the column? So I create another measure with a name?

 

I like to add some subtotals to it, like:

 

red         400

green     500

value1    900

purple    -100

value2    800

black     1000

value3   1800

 

 

Peter

 

 

@PeterG1

 

Not sure if you want the running total result. If yes, we can first add an index column in Query Editor.

syntax error_1.jpg

 

Then create a calculated measure with following formula.

Running Total = 
CALCULATE (
    SUM ( Table1[amount] ),
    FILTER ( ALL ( Table1 ), Table1[Index] <= MAX ( Table1[Index] ) )
)

syntax error_2.jpg

 

Best Regards,

Herbert

Yes. Peter you can do that but you need to post a full dataset to give you the exact solution. 

 

Thanks & Regards,

Bhavesh

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.