Dynamic Column Values in Power BI - powerbi

I have the below sample table and I want to make a filter where If I select Daily, to show the aggregated sales on a daily level with the days in the column headers, if I select monthly to show the months in columns and the aggregated sales for the month below and the same with week.
Is there any way using Dax or any other tool in PBI to allow me to have dynamic column values based on the filter?
Examples of same table and visuals below
Thank you
Sample Table
Monthly Filter
Weekly Filter

You can leverage time-intelligence hierarchy here. If your date field is datetime type, Power BI will auto-hierarchy this. Then you can drag the hierarchy date field into the visualization. By default it will include Year, Quarter, Month, Day.
You can remove the sections you don't need and then create bookmarks to snapshot certain filters.
This is one method to do this, let me know if it was helpful to get you going.

Related

Power BI slicer based on date

I am struggling to manage to set up a slicer in Power BI on date column.
The problem I have is that I have a table with SalesDate so I created a table with client name and date of last sale.
Then I added a slicer on date column and here I am stuck.
I would like to be able to mark date into a slicer so the table returned me all the customers who DID NOT buy anything from a specific amount of time: last three months for example.
By default slicer shows me those transactions who did happen in the period I provide to a slicer.
Can I do it in anyway?

Filter multiple columns using single slicer in power bi

I am new in power bi. I am creating a basic tabular report in power bi. But the catch is I have multiple dates columns in the dataset (For Eg. productvalidfrom,productvalidto,ordervalidfrom,ordervalidto). And I want to filter these columns with a single date selection.
If I select 2021-09-01 then condition for filter will be
2021-09-01>=productvalidfrom and 2021-09-01<productvalidto and 2021-09-01>=ordervalidfrom and 2021-09-01<ordervalidto
and need to all the columns from the dataset. No summarization.
Thanks in advance.
I have been able to implement this before. You will need to add a data table to your data sources. Then you will want to create relationships between the dates in your data and the date table. Only one of them will be active relationships, the rest will be inactive. Then, your slicer will use the date from your newly created date table.
This link should be able to guide you through the build.

How to display hierarchical data with slicer Power BI?

I have a data table:
I need to perform KPI for Organization, Team and every employee, KPI of Team is the data of the employees in the team, KPI of Organization is the data of all employees. The result I want is a diagram showing 3 KPIs of the selected object.
To do this, I created a Hierachy Slicer to filter the objects that need to be calculated:
My slicer works fine if I create Measure to calculate each KPI value but it doesn't work when I create a new Data table to store KPI values, I don't know where the problem is, please help me.

How to pull the latest records from sql table to POwer BI dashboard.?

I am a beginer to Power BI
I have loaded an sql table to power BI dataset. The table keeps udating with new records frequently. How can I always pull the data of the latest five records into the dashboard. There as id no which keeps growing with the no of rows.
another question, how can I show the dashboard specific to the current working day only? There is date stamp in the sql data. How can i use it? With filter I am able to select a particular date but to set it to current day or last week etc.
Thanks in advance.
If your data doesn't contain any field which would tell you, what then latest rows are, the there's not much you can do here. Apparently you have some sort of timestamp there, so a query something like this could work as the datasource for your report:
SELECT TOP 5 field1, field2... FROM Table ORDER BY Timestamp DESC
To your second question, you can add a reletive date filter: https://learn.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

Relating a Date Slicer from a different table for Filtering in Power BI

Currently, I have about three tables in my Power BI report.
1. First table lists retailer records for the year 2016. (Columns: CompanyID, Company, FullAddres, Status). So this would list records for the year 2016 from January 1st to december 31st
2. Second table is same as above but for the year 2017.
3. Third one is a Date Table I have created in sql server and then loaded in the power Bi.
I created visualizations along with some calculated measures. The goal is to use the DateTable as a slicer and upon filtering the Week Ending date in the slicer it should reflect the results. so basically DateTable has week ending date as a column and using which we i want to filter the results.
I have created Relationship of Date Table with other two tables but unfortunately when i filter, it doesn't work fine. Kind of results in 0 results.
The relationship of DateTable with both the tables is created as Many to one with cross filter direction set to both.(tried with single as well)
How should i make some changes so that i can use WeekEnding Date from DateTable as a slicer? Any help will be appreciated.