power bi year over year comparison and line chart - powerbi

I want a custom table/matrix in power bi displaying the year over year data and also a line chart displaying the same. i have all the year information in one column i.e both 2018 and 2019 data in one column. I want to perform an aggregate operation on another column and make the comparison for each of the month in the previous year
The checkout date column has all the date information for both years. The caring attitude column has the data for which i want to perform aggregation based on month
This is how i want the data to be displayed in the power bi
This is the line chart i want. Year over Year comparison of those values
In Excel I manually add the goal values in the rows and then create a graph

*for the former you just need to have date(years) as your rows date(months) as columns and caring attitude of staff as your values(this need to be done in a matrix visual and date should have hierarchy).
* for the latter date(months) as axis, date(years) as legend and caring attitude of staff as your values(for line chart).

Related

Show all data for month to date

In Power BI, I am creating a grid to show specific data in a time period. I want the grid to update everyday to show the data corresponding month to date. I want my data to represent 9/7 - 10/7 and tomorrow I want it to update to show 9/8-10/8. Essentially I want a measure in DAX to display all data from month to date.
You can do this from relative date filter in the right side tabs,
Select visualization and their is filter for date,
try with above method.

Change shared axis/hierarchy based on date slicer

I am having some trouble dynamically altering my x-axis based on a custom date slicer.
Basically it works fine if the end-user is looking at every single date between 2020 and 2021, however, if the end-user filters to just a couple months, I want the column chart to skip the Year and just jump to the MonthYear axis to remove the user having to start from the year then drill down to see the months.
Similarly, if it was just days filtered in the slicer it should jump to the Date axis rather than drilling down from Year then to MonthYear then finally to Date.
How would I go about doing this?
Date Slicer:
Stacked Column Chart:
Shared Axis:

Power BI -- Line chart -- Basic filtering -- Require single selection

I have a Line Chart in Power BI. I'm doing basic filtering on the year, so it shows all years between 2013 and 2020. I want the chart to only display one year at a time, so I check the Require single selection box. But is there a way to have it select the year dynamically based on the result of a measure?
you can define a filter on "visual level" either based on a measure or a calculated column.
If the visual is of type slicer you can only use a calculated column and not calculated measures.
E.g. if you create a calculated column "isCurrentYear" in your date table you can use that for filtering. based on which criteria you want to choose the year?

How to deal with missing dates in Power BI line charts? (Tabular SSAS)

In SSAS Tabular mode, we have different tables with slowly changing dimensions (SCD Type 2). In Power BI, we now want to show for example the price history for one object over time. I want to display that with a Line Chart.
For the sample data, I added a Line Chart and activated the "Stepped" property in "Shapes", to have a clear cut of the price change. But unfortunately, Power BI displays the price change on Oct 5th (because this is the middle date between 3th and 7th) instead of Oct 7th. I know, that I would be able to solve it on database view layer, but I don't want to create so much data records for all different tables.
PRICE TABLE
**************************************
Price Valid from Valid To
**************************************
3'674 02.10.2019 02.10.2019
3'674 03.10.2019 06.10.2019
11'095 07.10.2019 07.10.2019
11'095 08.10.2019 01.01.2999
**************************************
Is there any way to prevent this behavior in the Power BI visualization or can I somehow calculate the missing dates in DAX?
I would have use date field from date dimension which has all the continuous date, then you may change your axis type for date continuous and it will generate smooth transition.

Sort Month text (jan, feb etc.) in multiple year dataset

In Power BI I need to make a visual with a bar chart showing values over 12 months, from jan to dec. However, my dataset has 3 years of daily data, so I cannot sort by another helper column (monthsort) as there are more distinct values in the sort column than the result column.
How can I get an x-axis sorted from jan to dec?
I can make changes either in SQL Server table or DAX in tabular model.
NB: I cannot use date hierarchy, as I use Analysis Services and Live Connection.
You can create a new column called "DateSort" or something like that and use following DAX formula:
=FORMAT([Date],"YYYYMM")
Select your daily data column and choose "Sort by Column" and set it to "DateSort" column.
Does that work ?