How can I select last two dates in Power BI? - powerbi

I have list of dates 1st Nov 2018 to 9th Nov 2018. Now in Power BI I want to compare data of last two dates 8th Nov 2018 vs 9th Nov 2018.
I have tried putting date column in visual filter so that I can choose max two dates, but date filter is now appearing in that filter.
Kindly help

After adding the date column to the Visual level filters, you can change the Filter Type to Relative date filtering and specify is in the last 2 days.

Related

Power BI Rolling 12 Months nothing to calcuate?

I have an access database I am pulling data from. It has data going back to 2015 but I only want the data from the most complete 12 months. Today is 9/27/2021 so I would want data from September 2020 to August of 2021.
Sample data:
Date
Level
8/12/2019
Level 1
1/26/2021
Level 3
6/13/2020
Level 4
4/12/2021
Level 1
3/7/2015
Level 2
4/16/2021
Level 2
I want a simple bar chart where it has the month/year and the count per level
You can use relative date filtering is in the last 12 calendar months.
Here's what that looks like for today (9/28/2021):
Click your visualization on power bi desktop, expand date filter,
add 1 year
or you can add filter from transform data tab in power bi desktop

Choosing a Power BI Measure based on a slicer

I'm making a data report for my company which will have a slicer to select the quarter. I have colmuns for Beginning balance, each of the three months within the quarter (Per1, Per2, and Per3), Quarter to Date, and Year to Date. Right now, I have no problems getting the data into the right format. I've got a report with a SUM measure for each month, and "Per" measures with Switch functions to choose which SUM measures are being used.
What I'd like to do is be able to change the column names from Per1, Per2 and Per3 to the actual month being displayed (April, May, June for example).
Is there a way to either change column heading so it displays the name of the measure being chosen?
Alternatively, is there a way to use the slicer to choose which SUM measures are pulled into the report?
Right now, it looks like this:
Beginning Per1 Per2 Per3 QTD YTD
I'd like it to look like this:
Beginning Jan Feb Mar QTD YTD
I'd like to be able to change the months based on the selection of quarter in the slicer.
In Visualizations(right menu) you can try to change the data in the fields Legend and Values and you can play with Filters as well.
If it doesn't work you can change the column name when you connect to the excel data, it will change only on the query not in the source.

Highlight high to low numbers in a row in PowerBI

i have a table, Partner Group is common from one excel file
then i have 4 more files with dates: dec '18, dec '19, jan '20. feb '20
the four excel files in powerbi are connected via the partner group file.
i have no idea how to get it to highlight the row based on high to low. i have tried many ways but it wont work

How to add Hours to Date Hierarchy in Power BI

I have managed to create another Hierarchy with year, month, day, and hour
but it does not work as I wanted
I created a table that has Days and hours and linked it to my table.
The "Go to the next level in the hierarchy" does not accumulate for that period
i mean in that case I should get January for all years but what I get is Jan 2017, Jan 2018, Jan 2019
it act exactly as "Expand all down" button
Is there any way I can simply add Hours to the Date hierarchy
Create a calculated "hour" column in the fact table, for example,
Hour = TIME( HOUR( [AVHandoverHour] ), 0, 0 )
And, add it to the visual axis.

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 ?