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
jitterbug777
Advocate II
Advocate II

marketing campaign for Term Deposits, count term deposits achieved from campaign and create visuals

I`m new to power query, this mock sample data is based on a marketing campaign to find out the results of how many samples opened a term deposit after the campaign, and to create visuals to view what categories of data show the biggest uptake by ranking via matrix and bar charts, pie charts.

 

mock sample data 

 

Attribute Information:

   # bank client data:

 

   1 - age (numeric)

   2 - job : type of job (categorical: "admin.","unknown","unemployed","management","housemaid","entrepreneur","student", "blue-collar","self-employed","retired","technician","services")

 

   3 - marital : marital status (categorical: "married","divorced","single"; note: "divorced" means divorced or widowed)

   4 - education (categorical: "unknown","secondary","primary","tertiary")

   5 - default: has credit in default? (binary: "yes","no")

   6 - balance: average yearly balance, in euros (numeric)

   7 - housing: has housing loan? (binary: "yes","no")

   8 - loan: has personal loan? (binary: "yes","no")

 

   # related with the last contact of the current campaign:

   9 - contact: contact communication type (categorical: "unknown","telephone","cellular")

  10 - day: last contact day of the month (numeric)

  11 - month: last contact month of year (categorical: "jan", "feb", "mar", ..., "nov", "dec")

  12 - duration: last contact duration, in seconds (numeric)

 

   # other attributes:

  13 - campaign: number of contacts performed during this campaign and for this client (numeric, includes last contact)

  14 - pdays: number of days that passed by after the client was last contacted from a previous campaign (numeric, -1 means client was not previously contacted)

  15 - previous: number of contacts performed before this campaign and for this client (numeric)

  16 - poutcome: outcome of the previous marketing campaign (categorical: "unknown","other","failure","success")

  17 - y - has the client subscribed a term deposit? (binary: "yes","no")

_________________________________________________________________________________________________________________

 

I was trying to create an IF statement to convert the hasTermDeposit results to a 0 or 1 so I could use them as values in a matrix in visuals.

I also attempted to add a column and convert yes to 1 and no to 0 in Power Query so I could count that column in visuals.

 

IFsyntaxwrong.png

 

Thank you, any feedback is  helpful.

HASTD2.png

 

in power query created hasTD to convert no to 0 and yes to 1.

hasTD.png

 

also not sure why my talbe name is not being recognized in the DAX formula or the column names.

 

 

 

 

 

 

1 REPLY 1
philouduv
Resolver III
Resolver III

Hello @jitterbug777 ,

2 points :

  • On the image of your data we can see that you try to create a measure and not a calculated column (which I think is the reason why your tablis is not recogniye)
  • Your IF function is not properly written (IF function (DAX) - DAX | Microsoft Learn)
    I would write the calculated column like this :
    existingTD = IF(Sampledata[hastermDeposit] == 1, "yes","no")
    This way it will also take care of rows that have no data and will automatically put no

Have a good day

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.