I'm new to Power BI and I am having difficulties. I have some slicers as filters and two chart as below:
Sample Report
The bottom chart shows data with data according to date selected in the slicers which is straight forward. E.g. The slicer selected 15-Oct-2017, the bottom chart should shows 15-Oct-2017 as well.
The upper chart should shows the next 2 days of the selected chart, i.e. data of 16&17-Oct-2017 should be shown. How do I achieve this in a dynamic way so that when slicer selection change, this chart changes accordingly?
Thanks in advance
you can achieve this by creating 2 measures like that:
NextDayValue = CALCULATE(COUNT([columnYouWantToCount]), DATEADD([DateColumn],1,day))
Next2DayValue = CALCULATE(COUNT([columnYouWantToCount]), DATEADD([DateColumn],2,day))
and then use these measure in your charts.
Hope that helps!
Problem solved.
Refer to link below for complete solution
Solution Here
Related
Recently I came up with this problem:
I have a table with two different codes: COD1 and COD2. I want to create in power bi bar charts and tables with this information but I want to be able to change whether if I want to see them with COD1 or COD2. I have a slicer that gives you the option of which code you want the info be displayed. I've done this before with numeric data types because you can do this with a measure, however I don't know how to make it work with non-numeric columns.
COD1
COD2
Sales
AA
A10
5
AB
B45
10
CD
D44
20
I'm not exactly sure what you're trying to achieve but if I understand you correctly, you can change columns on a bar chart by making two bar charts. One will have COD1 as an axis with Sales, and the other will have COD2 as an axis with the same sales metric.
You could then use buttons and the bookmark functionality of Power BI to seamlessly "switch" the axis. See an example below:
I have a chart as below,
Here I have certain metrics which needs to be shown as Monthly, quarterly, yearly.
Ex. if monthly is selcted chart should show in months as mentioned,
if quarterly is selected chart should show in quarter and same applies for yearly.
So I tried with following code,
Created a table,
|Monthly|1|
|Quarterly|2|
|Yearly|3|
Created the selcted value measure as
select = selectedvalue('table1'[column2])
Created a switch to use that calculated column in axis of the bar chart,
switch[select]
1,'calendar[Month]',
2,'calendar[Quarter]',
3,'calendar[year]')
Output is showing as variant data-type cannot be used in calcualted column,
I understand that some values are either text or number, how to change accordingly to same datatype.
I have tried with zero also it is showing the same error.
Is there any other approach to this dynamic changing of columns?
You can add buttons and use bookmarks to assign action based on Month, Quarter and Year to those buttons, all you need to do is create 3 visuals and align them then based on buttons make the visual visible/invisible and the update the bookmark.
I have got a column chart with 79 geographies and a slicer with the 79 geographies. The column chart is NOT dependent on the slicer however there are other visualisations in the page that are dependent on the slicer.
What I would to achieve is when I select a specific geography in the slicer the bar that corresponds to that selected geography should be highlighted (i.e. a different colour fill). Can someone please let me know if it is possible to achieve.
I was able to achieve this partly by creating an independent slicer. Not coming from the table or joined to the table. I created 2 new measures, one that shows the selected value in the slicer and the second measure to give it a colour. I used this to change the data colour by using "fx" to determine the colour of the column. I am attaching the Power BI file that shows this solution for your reference.
But by doing an independent slicer my other visualisations don't update. I am wondering if it is possible to achieve this without creating an independent slicer so that my other visualisations are not affected.
Any help is greatly appreciated. Thank you.
Measure 1: Measure = SELECTEDVALUE(Locality[Locality])
Measure 2: Colour = IF(MAX(Sheet1[Locality]) = selectedvalue(Locality[Locality]),"red","blue")
Please see below the screenshot and also link to the sample .pbix file for your reference.
Sample Power BI file - https://1drv.ms/u/s!AubIV2PXG9p4gqhykbbmeMfFYlChCw?e=w6UABf
Disconnected table solution file - https://1drv.ms/u/s!AubIV2PXG9p4gql1_KvyEK82cZZDMw?e=7TAR6i
You did a great trick as I checked your solution file. But slicer not working as expected which is your issue as per your explanation. To make it work, you can just think reverse of what you have done now.
You have separated slicer value from other data, so that selecting a value in the slicer still keep all Locality in the Bar chart. But problem is, its also keeping all localities in other charts where you wants to take effect of slicer selection. Right?
If the above explanation and assumption is correct, just separate your Locality and Population column to a different island (no relation) table. And create your BAR chart from the new table. Now, if you select a value in the slicer, all charts will be filtered accordingly but the BAR chart.
Finally, apply the Color measure to FX as you implemented currently. This will work as I tried it here and got success. Following is the sample output-
I want to create a target and current amount of data in a power KPI chart. I have tried a lot but the lines are not shown properly in the chart. I have attached a screenshot of my chart.
I want to show the target and the current status separately via lines per month.
try using Gauge Visual it will give you both in this i am unable to understand your data can to please share what are the fields you are using and how
https://learn.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-radial-gauge-charts
above will show you how to use Gauge
Drag the line-chart from the visualizations pane and then add Date to axis then drop current and target values under the value field.
If not working then post sample data to work with.
I have a Clustered column chart in Power BI which has a category and date on the Axis so that there's a hierarchy to view the data on. In the hierarchy view, each column in the chart has the full hierarchy name below it. I would like to have the category name once only and then the dates for each column specified instead of the dates and category name with each date repeated. So I would like for the hierarchy labels to have their own "grouping" as it were. Is anyone able to assist with this please? I don't want to pivot the data because then there's a legend that viewers of the report need to look at to see what color column matches up to which date in the chart which isn't practical.
If anyone does run into this I ended up using the Infographic Designer custom visual that I imported from the Power BI Marketplace. With this I was able to achieve what I wanted by using the "Column By" feature of the visual. This gave me multiple charts for the different groups of data I wanted to view.