I am trying to create a new column in my Power BI project like this:
However, I am running into difficulties because of the fact that my data set contains null values:
And as a result I get this error.
If I enter Month values in to my data for nulls the formula works e.g.:
Does anyone have any idea on a workaround for this?
Here is how I have my table formatted in the Query editor:
With Null Values:
With No Null Values:
Thank you.
To Start with I had data looking like this
On Query Editor, Right Click the Column "Value" and Duplicate it.
You will get something like this-
Now, click on the duplicated column header and change its name to MonthNumber.
Right Click on the Month Number Column and click on Change Type and Select Date
Once you have Selected Date, Right Click on the Column Again and Click on Transform, Select Month and Month Again.
So now you will have your MonthNumber.
Let me know, if this doesn't help.
Related
I have a PowerBI sheet consisting of multiple visuals and one slicer. The underlying data set includes one column called "selected" consiting of either "1" or "null". I want the slicer to always be default setted to only show data where the data entries in column "selected" are equal to "1". I want that the user is still possible to modify the selection and then be able to press a button to return to the pre-selection. I found no way possible to do this. Do you guys have any idea? I am pretty new to PowerBI.
I only found a way to pre-select the whole sheet or slicer to only show values where "selected" =1 but I want the user to be able to further select data. Also I only saw solutions for pre-selected slicer based on dates (e.g. most recent date is pre-selected).
What you need to do is to preselect all filter and save "bookmark" (view tab in powerbi desktop); Then you can assign a bookmark to the button.
Read this article:
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-bookmarks?tabs=powerbi-desktop
I am attempting to create a cumulative graph much like this one:
I have the following table in PowerBI
BugHistory
BugID
Date (date)
DateTo (date)
EntityStateName (text)
Effort (number)
I would like to do a measure that would tell me the amount of summed Effort on any given date for each EntityState.
I have tried quite a few things, even adding a Date Table using the Calendar, but getting the values to be shown correctly on a StackedGraph seems to be beyond me.
Hope someone can help.
Follow the following steps:
Right click on the column "Effort" and click the option called "New quick measure" in the right click menu.
In the window that appears, choose "Running Total" under the Calculation drop-down
This will show 3 new fields
In the Base Value field, drag and drop the "Effort" column
In the Field column drag and drop the "Date" column.
In the direction column choose Ascending
This will create a new measure in your Table. You can use that measure in you chart.
You can refer to the following video for reference: https://youtu.be/KlXclbN4oWE?t=497
I would like to create a date filter for all pages in my report.
I've tried using a date slicer, however, it defaults to "on this visual".
try using the following formula to create a table:
Calendario = CALENDAR(DATE(2018,01,01),DATE(2019,12,31))
--The first date would be the lower bound and the second one the upper bound.
Then procede to link every table date to this specific table. If you have a Date variable for each one table, it will not filter all the data.
Also, you can try going to View and selecting Sync Slicers. Another way of doing this is copy and pasting the filter in another page. It will show a dialog box that will ask if you want to sync all the slicers.
I have a PowerBI Report showing columns of figures representing hours of support we've sold by customer. Those figures are calculated in PowerBI by men.
But some customers haven't bought any support - so I want to show those columns for those customers as blank, not zero.
I can do this easily by turning the whole column to text, rather than numeric, and the blank fields can just be "". But users want to be able to export the visual and have the numbers be numbers (not text) when it gets to Excel.
Is there any way I can have 0 values show as blank in this case?
I'm not sure how you've set up your data and what you'd really like to do with it. But until we get some clarifications here's is my take on it:
Some sample data:
Hours,Customer
1,AA
2,BB
2,CC
0,DD
4,EE
If you import that data using Get Data and activate the Power Query Editor, you can right-click Hours, select Replace Values and replace 0 with null to get this:
Click Close&Apply to get back to the desktop and select a Clustered Column Chart. Assign Customer to Axis and Hours to Values so that you get this:
As you can see, DD is not there, which I believe is how you'd like to illustrate your data. But now you can also click Customer under VISUALIZATIONS > Axis and select
Show items with no data:
And you'll get this:
If you now select Export Data you'll get a txt file with all the customers, but with no data for customer DD that originally had the value 0:
Please let me know if this is not what you were looking for.
I have imported an excel file for creating a PBI report. In this excel, there is a cell which contains a date. I want to create columns on the basis of this cell.
Like if the cell contains 01/04/2017 then I would like to generate column names like Apr-17, May-17, ..., Dec-17, Jan-18,..., Mar-18.
If there any way to do this?
I'd say just create a step by step procedure in edit query to pivot the table.
First you'd only get distinct values, then pivot and then promote to headers.
I don't think you need a column per month.
1) Create a query to import your file
2) In Query Editor, select the query, then "Transform" -> "Use First Row As Headers"
3) "Transform" -> "Unpivot Columns"
4) Rename columns as desired
Now you have a table in a comparable/filterable/queryable form. You didn't specify what you need it for but having a column per month won't work well (for various reasons). PowerBi doesn't work quite like excel.
If you really wanted a column per month, you could stop at step 2) but I would advise against it.