Forum Discussion
Calculated Column not being displayed in visual correctly?
Hello,
So I have an Excel file with some data, and I am trying to have it display in Power BI. I created a date table so I can have the information broken down by month. What I am trying to do, is I created a calculated column where one row is divided by another row. When I put that calculated column into the "Value" section of a bar chart I am not getting any data to appear. I have the "Type" of that column set to be a decimal value. I can attach a picture of what is going on, but I just need some help to figure out how to attach a picture.
Thank you!
Here you go. I had to make a number of changes.
- Created a date table and related it to your data table.
- Created a date in your data table. "January" won't work. Made it Jan 1, 2020 for example.
- Created measures for Total Employee Count, Total Amount Overdue, Average Overdue, and maybe 1-2 others.
- Redid your chart.
You cannot bring in averages and percentages in your source data and do anything with it. You have to do all of that with measures or it won't roll up right.
As a rule, you NEVER want to drop numeric columns in the VALUES area of a chart or visual. You only want to drop Measures there. The reason is when you drop a value, Power BI creates an implict measure, and you cannot control it as well as you can an explicit (user created) measure, and you may not understand weird results as your model changes, as Power BI is doing what it thinks is best, not necessarily what you want.
10 Replies
- edhansCommunity Champion
Consider moving that calculation to Power Query, when you brought that column in. There you can ensure the data types are correct.
CLick on the little box at the top left of the column to set the type after you do your formula. Add a custom column. Below it is just [Numbers] / 2
To attach an image, click on the camera icon and upload it. You cannot paste an image on this forum.
In general, try to avoid calculated columns. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:
Calculated Columns vs Measures in DAX
Calculated Columns and Measures in DAX
Storage differences between calculated columns and calculated tables
Creating a Dynamic Date Table in Power Query- BrandonP2121Helper II
Okay, so what I did is I just did the calculation I wanted to do in Excel and just brought it over to Power BI. My issue is that I just want the numbers to display as they are calculated, and when I put the column into the "Value" section I can't get them to just display properly. I get the options for like "Sum, Variance, Count";etc. Is there something I am doing wrong? I have my calculation column set as decimal number.
- edhansCommunity Champion
CLick "Don't Summarize"
- Greg_DecklerCommunity Champion
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490