cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stanley88
Frequent Visitor

Creating measure and calculated column in Advanced Editor using M language

How can I create measure and calculated column in Advanced Editor? And I don't see the calculated column shows up in the Advanced Editor as well.

 

I am inquiring this because I need to create similar measures and calculated column in multiple tables (around 30+ tables) as follow:

 

Screenshot_1.png

 

 

 

 

 

 

 

 

 

Thus, I would like to do some automation to get this done. Going to every table and creating each of these measures would not be very efficient, I am looking for some way to write a script (like the one in advanced editor using m language), that will automatically creating all these things in one go.

 

Is it possible in Power BI? Or any alternative solutions are welcome.

 

Thanks very much in advance.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User IV
Super User IV

Re: Creating measure and calculated column in Advanced Editor using M language

Hi,

Measures and calculated columns are writtein in the DAX language by going to the Modelling tab.  They cannot be written in the Query Editor.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Super User IV
Super User IV

Re: Creating measure and calculated column in Advanced Editor using M language

Hi,

Once can only create one measure at once and use that in unlimited visuals.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Super User IV
Super User IV

Re: Creating measure and calculated column in Advanced Editor using M language

Hi,

Measures and calculated columns are writtein in the DAX language by going to the Modelling tab.  They cannot be written in the Query Editor.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Highlighted
stanley88
Frequent Visitor

Re: Creating measure and calculated column in Advanced Editor using M language

Hi Ashish,

 

Are there any options in Power BI to create multiple measures at once?

 

I am aware that the current design of Power BI can only create a single measure at once.

 

Please correct me if I am wrong.

Super User IV
Super User IV

Re: Creating measure and calculated column in Advanced Editor using M language

Hi,

Once can only create one measure at once and use that in unlimited visuals.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

stanley88
Frequent Visitor

Re: Creating measure and calculated column in Advanced Editor using M language

Hi,

 

So do you mean that there is no way to automate these tasks?

Super User IV
Super User IV

Re: Creating measure and calculated column in Advanced Editor using M language

No.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
arherva
Frequent Visitor

Re: Creating measure and calculated column in Advanced Editor using M language

If you have highly similar columns and you want to quickly "copy-paste" the measures from table to another then I would consider using a clever naming convention coupled with the following "horrible" dax formatting for the measures:

 

MeasSumTable1 = SUM(
    Table1
    [Column1]
)

 

This way you can minimize the clicks and other mechanical msucle movements needed for each copy-paste. But it ain't pretty code! 😄

Helpful resources

Announcements
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors