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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Gianluigi
Helper II
Helper II

New measure

Hello
excuse the question. I would like to create a new measure. After giving the name after the = sign I write in DAX. I can't figure out how to wrap by creating automatic line numbering to write on multiple lines.

Thank you

9 REPLIES 9
Gianluigi
Helper II
Helper II

Hello
I found the solution. I probably didn't explain myself.

With shift + Enter you wrap and the lines are numbered

mussaenda
Super User
Super User

Hi @Gianluigi ,

 

Since we cannot get wht you really need, this link might help you

Using DAX Variables In Power BI - A Detailed Example | Enterprise DNA

Hello
my problem is not the syntax of dax but that I can not automatically number the lines of code.

Example

DAX =

1 ....
2 .....
3 .....

 

thank you

Hi @Gianluigi ,

 

I dont understand, 

There are line numbers in dax already

 

mussaenda_0-1694169402766.png

 

I create a new measure as in figure 1. The line number 1 is numbered with the name of the measure after the = sign
How do I wrap so that the second line is automatically numbered with the number 2? as in the second image.
Pressing enter does not wrap.

 

 

 

 

 

I hope I made you understand

12e6ec77-2cf6-4650-9095-77fec4ecd0d2.jpg

Img2.jpg

 

Gianluigi
Helper II
Helper II

Hello
For example, this code
1 var1 =
2 VAR _WorkStart =
3 TIME( 8; 00, 0 )
I copied and pasted it. If I want to write it I type var1 = then I would like to wrap so that you number the second line ect. Ect. After writing var1 =

Anonymous
Not applicable

Hi @Gianluigi ,

 

I think 1 should be the name for first var, you need to add a space between it and VAR function.

Your code should look like as below.

Dax =
VAR 1 = ...
VAR _WorkStart = TIME(8,0,0)
RETURN
...

If this reply still couldn't help you solve your issue, please share a sample file with me.

 

Best Regards,
Rico Zhou

 

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

 

 

Anonymous
Not applicable

Hi, could you please give more information and paste your dax code. If we could get examples of how you would like the formula to work we can help you all the better. Thanks!

Hello
my problem is not the syntax of dax but that I can not automatically number the lines of code.

Example

1 var1 =
2 VAR _WorkStart =
3 TIME( 8; 00, 0 )

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors