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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
rayishome
Resolver I
Resolver I

Adding Custom Columns when Creating A Dataset via the API

Is there a way to create a calculated column when creating a dataset.  

 

Folliwing the API reference: https://msdn.microsoft.com/en-us/library/mt742155.aspx

 

It seems we can create an Expression for a Measure, but maybe not for a Column?  I would like to add an If Statement on a Measure as a Custom Column.   This is easily accomplished in Desktop, but not sure if the API supports this or not.  

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee


@rayishome wrote:

Is there a way to create a calculated column when creating a dataset.  

 

Folliwing the API reference: https://msdn.microsoft.com/en-us/library/mt742155.aspx

 

It seems we can create an Expression for a Measure, but maybe not for a Column?  I would like to add an If Statement on a Measure as a Custom Column.   This is easily accomplished in Desktop, but not sure if the API supports this or not.  


@rayishome

AFAIK, custom column is not supported. What is your scenario that a custom column is mandatory? Maybe you can just create a normal column for the dataset and implement the if statement when Adding Rows.

View solution in original post

3 REPLIES 3
Eric_Zhang
Microsoft Employee
Microsoft Employee


@rayishome wrote:

Is there a way to create a calculated column when creating a dataset.  

 

Folliwing the API reference: https://msdn.microsoft.com/en-us/library/mt742155.aspx

 

It seems we can create an Expression for a Measure, but maybe not for a Column?  I would like to add an If Statement on a Measure as a Custom Column.   This is easily accomplished in Desktop, but not sure if the API supports this or not.  


@rayishome

AFAIK, custom column is not supported. What is your scenario that a custom column is mandatory? Maybe you can just create a normal column for the dataset and implement the if statement when Adding Rows.

We are trying to display the last inserted record from a push dataset.
Anonymous
Not applicable

One method to display the last inserted record would be to use a "Top N" filter. If you have a date/time column (or another id field) that is included in the data you would just set it up in the following manner:

Capture.PNG

Then whenever you push new data the filter will ensure only the last record gets included.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors