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! Request now

Reply
diogobraga2
Helper IV
Helper IV

Data vs Model Tab Calculation Differences

I still figuring it out the difference between calculation in the Data vs Model tab, any insights are appreciated. 

 

I am considering switching a calculation from Data to Model, so I copied and pasted the working formula from Data tab to the Model tab. I am getting the following error message 'Token RightParen expected'

 

Here is the working formula from the 'Data' tab:

 

apptime_adj = if([academid_year]="2016-2017",DATEADD(application_view[apptime],1095,DAY),if([academid_year]="2017-2018",DATEADD(application_view[apptime],730,DAY),if([academid_year]="2018-2019",DATEADD(application_view[apptime],365,DAY),[apptime])))
1 ACCEPTED SOLUTION

Hi @diogobraga2 ,

 

The if else statements are also written differently in the M Language. Try this:

 

= if [academid_year]="2016-2017" then Date.AddDays([apptime],1095) else if [academid_year]="2017-2018" then Date.AddDays([apptime],730) else if [academid_year]="2018-2019" then Date.AddDays([apptime],365) else [apptime]

View solution in original post

9 REPLIES 9
Nathaniel_C
Community Champion
Community Champion

Think it is at the end as you have three ifs and a Dateadd





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I triple checked, and I can't find a missing paren. I copied and pasted again from Data tab and I am certain it's exactly the same calculation...but on Model tab is giving me this error!

 

2019-10-10_1526.png

You are trying to copy your DAX expression in M Language.

 

DATEADD (DAX) is achieved by Date.AddDays in M Language. Refer the following for M Language:

https://docs.microsoft.com/en-us/powerquery-m/date-adddays

Thanks! I fixed the syntax, but still getting the same error. What else do you suggest? 

 

2019-10-10_1536.png

Hi @diogobraga2 ,

 

The if else statements are also written differently in the M Language. Try this:

 

= if [academid_year]="2016-2017" then Date.AddDays([apptime],1095) else if [academid_year]="2017-2018" then Date.AddDays([apptime],730) else if [academid_year]="2018-2019" then Date.AddDays([apptime],365) else [apptime]

This script worked. Thanks!

 

if [academid_year]="2016-2017" then Date.AddDays(application_view[apptime],1095) 
else if [academid_year]="2017-2018" then Date.AddDays(application_view[apptime],730) 
else if [academid_year]="2018-2019" then Date.AddDays(application_view[apptime],365)
else [apptime]

Did you click on show error?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




tarunsingla
Solution Sage
Solution Sage

There shouldn't be any difference. The section does not matter (Data vs Model) when creating calculated columns/measures.

The error indicates a missing bracket ')' in the formula. Could be a copy paste issue.

Nathaniel_C
Community Champion
Community Champion

HI @diogobraga2 ,

I can't see it right off, but I would add a paren at the end. If that doesn't work, CTRL x all except the first test, then add back in piece by piece. You can copy the whole thing and paste it into a text pad or Word. Sometimes it helps to put in another medium.

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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