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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
marcelfirk
New Member

Syntax Error

Good morning, I created these formulas with conditionals to meet the needs, they work perfectly in the local PowerBI 
but when trying to use this code in APP.POWERBI to introduce in the data flow it is giving several syntax errors that I could not solve.
Coligada do aluno ajust 2022 = var anterior = if('Consulta BD'[Vencimento real]<=year(2021),1,0)
return  
if(anterior=0&&'Consulta BD'[Coligada do aluno]="34"&&'Consulta BD'[Filial do aluno]="1", "999",'Consulta BD'[Coligada do aluno])

inadimplente = if(AND('Consulta BD'[Data de vencimento]<today(),'Consulta BD'[Data de baixa]=blank()),1,0)
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @marcelfirk 

 

Are you going to add two columns to a table in a Power BI dataflow? If so, this can be done with M code. 

 

You can add two custom columns with below code

if [Vencimento real] > 2021 and [Coligada do aluno] = "34" and [Filial do aluno] = "1" then "999" else [Coligada do aluno]
if [Vencimento real] > 2021 and [Coligada do aluno] = "34" and [Filial do aluno] = "1" then "999" else [Coligada do aluno]

vjingzhang_0-1655288643545.png

vjingzhang_1-1655288690903.png

vjingzhang_2-1655288870011.png

 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @marcelfirk 

 

Are you going to add two columns to a table in a Power BI dataflow? If so, this can be done with M code. 

 

You can add two custom columns with below code

if [Vencimento real] > 2021 and [Coligada do aluno] = "34" and [Filial do aluno] = "1" then "999" else [Coligada do aluno]
if [Vencimento real] > 2021 and [Coligada do aluno] = "34" and [Filial do aluno] = "1" then "999" else [Coligada do aluno]

vjingzhang_0-1655288643545.png

vjingzhang_1-1655288690903.png

vjingzhang_2-1655288870011.png

 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

AlB
Community Champion
Community Champion

Hi @marcelfirk 

You talk about Dataflows, which uses M like Power Query, but the code you show is DAX

Can you clarify?

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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