Power BI: Bar chart with percentage - powerbi

I need to get a bar chart that displays percentages based on the simple division of 2 values. See below:
The calculation should be 'Services / Sum of Accounts' to get my %. (116,713 / 121,756 = 0.9585 [or 95.9%])
I have tried using Quick Measure, but I can't seem to get it to do what I want. I come from a background of SSRS, but the way PBI works appears to be different enough that I'm not sure how to accomplish this otherwise simple operation. Much thanks!

You probably need to write your own measure. You can start with a quick measure and modify the formula or create one from scratch.
I don't know what your data looks like but it might be something like
SUM(Table[Services]) / SUM(Table[Accounts]).

Related

how customized the decimal points of data label in bar graph in Power BI

I have bar chart below which looks like below - in that i have measure for Achievement % (in this graph 100% showing with two decimal i.e. 100.00%)
but i got a feedback from leadership that "100% value should not be in decimal". I played a lot with dax and formatting but did not get the result like below. (like shown in below graph, i want only 100% without any decimal i.e. 100% and rest all value should be with two decimal)
is this possible in PowerBI like excel. if yes then what will be the workaround.
Please suggest
Regards,
SK

Power BI DAX - Measure to change name of row value

I need some help creating a measure to change the name of "FROM_USER" in the slicer here.
I think I need to use the function SELECTEDVALUE, but I have not managed to get it working.
So, the column has only two values, CRAWLER and FROM_USER.
Any suggestions would be helpful!
See picture
Measures can't be used as slicer values. If you want the column values to be changed and yet to be used in a slicer, you need to create a calculate column to change that.
Column = IF('Table'[Column1]="FROM_USER","desiredValue","CRAWLER")
If you are really keen on using a measure to slice, you need to build a disconnected table and follow the method described here. But the performance will take a hit depending on how complex your data model and calculations are.

power bi taking count of number

iam taking simple clustered bar chart and want to take top 10 rows of computers that goes out of warranty
so ideally my chart should look like this
but instead my bar chart is looking like
i dont want count of count of count
can you please help me out how to add exact number in bar chart or am i taking wrong visual?
I believe you need to change your X via rightclick on the "Values"-Slot to something more like "Minimum", "SUM" or "Average". PowerBI doesn't seem to know you have one value only and attempts to group them. Hence it informs you that the "count of values(count)" is always one.

Creating a measure using DAX function Left on a table from Azure Analysis service

I am trying to get the first 4 digits from a string from a table in Power BI. The connection is a live connection / Direct which does not allow me to edit the query. Also, I am unable to create a new column. So I have to stick with creating a new Measure.
Now, I am using the following formula to get what I need.
LocationCd = mid(vw_DW_Contracts[ContractNumber],1,5)
but, this is not working a the vw_DW_Contracts table cannot be used in a measure. Is there a workaround to such problem?
I do not have access to the analysis service so cannot make any modifications in the source.
Please help.
Thanks
but, this is not working a the vw_DW_Contracts table cannot be used in a measure.
I'm not sure what you mean by this, but I'm guessing the message you see is telling you that measures expect an aggregation. The formula you posted would be great as a calculated column where it can be evaluated row by row. Measures are aggregations over multiple rows.
If you are trying to make a new field that is the location code that can be used in visuals on a categorical axis, this should be a column rather than a measure. You could write a measure to show a location cd using something like LASTNONBLANK (mid(vw_DW_Contracts[ContractNumber],1,5), 1) but I doubt that is what you want.

Can Power BI add range selection to a Line Chart?

I'd like to build a report with power BI line chart. For there are too many values on the X-Axis, I was trying to add a range selection on the X-Axis like what amChart does.
So, I'm wondering if power BI can do this.
Also, I want to add hyperlink to each value on the X-Axis to link to related shared folder, is it doable?
For time range selection, take a look at https://app.powerbi.com/visuals and try the Advanced Time Slicer visual. It might already do what you're looking for.
For the x-axis urls, you have several approaches you can try. The easiest approach is to have a related table in your report that shows the links. Then when a user selects a datapoint in your line chart, the table would update to show the relevant links. Alternately you might try to extend the Power BI line chart with your own logic. This might be hard since Cartesian charts are more complex than other charts. You can find the line chart code here: https://github.com/Microsoft/PowerBI-visuals/blob/master/src/Clients/Visuals/cartesian/lineChart.ts
Alternately you can just write your own purpose built visual that does exactly what you want. This might actually be easier than extending the Power BI chart. You can learn how to build your own visual by looking at our wiki: https://github.com/Microsoft/PowerBI-visuals/wiki
I was thinking about this more and wanted to mention one more solution. If you're looking to show the 'last n days' of data, instead of an arbitrary range, you can add a measure in DAX that returns the last days. I have an example here: http://blogs.msdn.com/b/lukaszp/archive/2015/08/08/finding-the-latest-date-in-power-bi-desktop.aspx