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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
erceve
Helper I
Helper I

Formula style differences between different machines

Hello, I have a problem where formula's work on one machine but not on the other. I've made a template file which my company can use as a base fro reporting, this file contains a calendar created with a formula:

 

Kalender = 
  GENERATE ( 
    CALENDAR ( DATE ( 2020; 1; 1 ); today()  ); 
    VAR currentDay = [Date]
    VAR weekday = WEEKDAY( currentDay; 2 )
    VAR week = WEEKNUM( currentDay )    
    VAR day = DAY( currentDay )
    VAR month =  MONTH ( currentDay ) 
    VAR year =  YEAR ( currentDay )
  RETURN   ROW ( 
    "dag"; day; 
    "weekdagnummer"; weekday;
	"weekdag"; switch(weekday;
					1; "maandag";
					2; "dinsdag";
					3; "woensdag";
					4; "donderdag";
					5; "vrijdag";
					6; "zaterdag";
					7; "zondag");
    "week"; week;
    "maandnummer"; month;
	"maand"; switch(month;
					1; "januari";
					2; "februari";
					3; "maart";
					4; "april";
					5; "mei";
					6; "juni";
					7; "juli";
					8; "augusutus";
					9; "september";
				   10; "oktober";
				   11; "november";
				   12; "december");
    "jaar"; year )
  )

 

 

On the machine where I've created this it works perfectly, when I save the pbix and open it on my laptop (different machine)

 

the semicolons are replaced with comma's and the date formula doesn't work anymore, it's replaced with DATE ( 2020, 1, 1 ), the ones get underlined in red and the errror says: unexpected expression '1,'.

 

Same goes for the switch cases inside the formula's where the switch recognizes the values but not the results, i've tried putting the results in either double or single quotes but to no avail. Can somebody please explain me what's going on and how to make this formula work on any machine?

1 ACCEPTED SOLUTION

Hi @erceve ,

 

This really looks a strange issue. Can you check your separator settings on your machine under Regional settings?

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

15 REPLIES 15

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.