Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Community (me again);
I build a powerquery that works (80%) so I´m asking for help to made it to work 100%
Have a table with codes and I need to create a new column based on these codes.
Code below:
= Table.AddColumn(#"dbo_BI-Despesas", "Custom",
each if [nCodGrPg] = 1003 then "Despesas"
else if [nCodGrPg] = 12 then "Investimentos"
else if [nCodGrPg] = 1000 or [nCodGrPg] = 1001 or [nCodGrPg] = 1002 then "Gastos"
// (This line isn´t working, it doesn´t filter the data as expected, should ALL except the filtered values "<>" , what I´m doing wrong"?) // else if [nCodClPg] <> 999 or [nCodClPg] <> 201 and [nCodGrPg] <> 1000 or [nCodGrPg] <> 1001 or [nCodGrPg] <> 1002 or [nCodGrPg] <> 1003 or [nCodGrPg] <> 21 or [nCodGrPg] <> 999 or [nCodGrPg] <> 201 then "Custos"
else if [nCodClPg] <> 999 then "Despesas-Geral-999"
else if [nCodClPg] <> 201 then "Despesas-Geral-201"
else "Null")
Thanks in Advance
Solved! Go to Solution.
@Mahesh0016 this link have sample data https://we.tl/t-LS6g2O4qhg, you will see in the "classificação" column four types, but the filter for "Custos" isn´t working as expected, another two examples below which are working:
DAX:
fell free to ask if you still have question, thanks in advance!
@Mahesh0016 this link have sample data https://we.tl/t-LS6g2O4qhg, you will see in the "classificação" column four types, but the filter for "Custos" isn´t working as expected, another two examples below which are working:
DAX:
fell free to ask if you still have question, thanks in advance!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |