Forum Discussion
Add New Column: % calculated from columns
Hi all,
How do I add a new column which is a calculation of two columns below to create a %?
i.e. open jobs/advertised open jobs *100 = %
The first row would be 90%
Open Jobs column is a count of a text column.
Advertised Open Jobs column is a sum of a conditional column.
Thanks,
Henry
Not sure, I got the problem
New column = divide([Advertised Open Job],[Open Job])*100
New Measure= divide(sum([Advertised Open Job]),sum([Open Job]))*100
Edited**
5 Replies
- kentylerSolution Sage
You don't say whether [Open Jobs] and [Advertised Open Jobs] are calculated columns or measures.
If they are measures you could write something like
Percent Open Jobs = DIVIDE([Open Jobs]/[Advertised Open Jobs]) * 100
The DIVIDE will protect against division by zero
I'm a personal Power Bi Trainer I learn something every time I answer a question
The Golden Rules for Power BI
- Use a Calendar table. A custom Date tables is preferable to using the automatic date/time handling capabilities of Power BI. https://www.youtube.com/watch?v=FxiAYGbCfAQ
- Build your data model as a Star Schema. Creating a star schema in Power BI is the best practice to improve performance and more importantly, to ensure accurate results! https://www.youtube.com/watch?v=1Kilya6aUQw
- Use a small set up sample data when developing. When building your measures and calculated columns always use a small amount of sample data so that it will be easier to confirm that you are getting the right numbers.
- Store all your intermediate calculations in VARs when you’re writing measures. You can return these intermediate VARs instead of your final result to check on your steps along the way.
- amitchandakSuper User
Not sure, I got the problem
New column = divide([Advertised Open Job],[Open Job])*100
New Measure= divide(sum([Advertised Open Job]),sum([Open Job]))*100
Edited**
- HenryJSPost Prodigy
Hi amitchandak
Both 'job ref as 1' and 'HasAdvert as 1' are calculated columns.
I input the below formula but too few arguments were passed to the divide function?
- amitchandakSuper User
Please use , instead of /