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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Invesco
Helper V
Helper V

M Script Error

Hi Experts

 

I cannot see where the error is in the following M Script as a custom column in Power Query

 

#"Add Custom" = Table.AddColumn(Source, "Status", each 
        if [#"Dataset"] =  "" and  Date.Month([Date]) = 4 then "A" else [#"Dataset"] 
4 REPLIES 4
v-yaningy-msft
Community Support
Community Support

Hi, @Invesco 
Thanks for nilendraFabric's reply. It doesn't look like there's anything wrong with your code, you can try his suggestion and if it still doesn't work, you can share the pbix file with no sensitive data for testing.

vyaningymsft_0-1738909765387.png

 

Best Regards,
Yang

Community Support Team

nilendraFabric
Community Champion
Community Champion

 

HI @Invesco 

Give this a try 

#"Add Custom" = Table.AddColumn(Source, "Status", each
if [Dataset] = "" and Date.Month([Date]) = 4 then "A" else [Dataset])

@Invesco Did it worked?

Still updating file. is a big PBIX

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors