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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
BrandonP2121
Helper II
Helper II

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!

1 ACCEPTED SOLUTION

Here you go. I had to make a number of changes.

  1. Created a date table and related it to your data table.
  2. Created a date in your data table. "January" won't work. Made it Jan 1, 2020 for example.
  3. Created measures for Total Employee Count, Total Amount Overdue, Average Overdue, and maybe 1-2 others.
  4. 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.

 

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

10 REPLIES 10
Greg_Deckler
Super User
Super User

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



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
edhans
Super User
Super User

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

2020-03-26 09_56_55-20200318 - Grouping Data to Count - Power Query Editor.png

 

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



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.

CLick "Don't Summarize"

 

2020-03-26 11_14_43-20200318 - Grouping Data to Count - Power BI Desktop.png



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Here is what is going on. The first picture is what I currently am seeing, I don't see where it showed up for you, but I went into the Data view and click "Do not sum" for all the columns.

power bi 3.jpg

 

 

 

 

What I am trying to do is get the numbers in the Average Overdue Column to appear just as they are. Is it potentially an issue with my date table? I am trying to display the results by month.power bi 2.jpg

 

 

 

 

 

 

 

 

 

 

 

Since all of the amounts are the same in the chart, you either haven't created a relationship between the date table and your data table, or the date fields in one or both are not correct and not filtering properly.

 

Beyond that, you'll need to share your PBIX file with some sample data in it to see what is going on.

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Okay, bear with me, but I uploaded this to a Google Drive and this is the link :https://drive.google.com/open?id=1uXxnXlxz-1D5RBk-Jltl70OzLeq0cJqR

 

Let me know if this doesn't work!

 

Thank you for all your help!

Here you go. I had to make a number of changes.

  1. Created a date table and related it to your data table.
  2. Created a date in your data table. "January" won't work. Made it Jan 1, 2020 for example.
  3. Created measures for Total Employee Count, Total Amount Overdue, Average Overdue, and maybe 1-2 others.
  4. 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.

 

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

This is exactly what I was looking for! Thank you so much!

Great @BrandonP2121 . Hope that gives you enough to keep your project going.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.