Power BI AR Aging Buckets - powerbi

I am fairly new to Power BI and I'm building an accounts receivable aging report with 30, 60, 90, 120 buckets. I've got all the data and totals displaying correctly in a table, until I try to sort them into the buckets.
When the user enters an as-of date in a slicer, the aging balance should adjust accordingly (this works fine) and the balance should display in the appropriate bucket (I can't get this to work). I have a separate date table related to the charges table by the date of the charge, and I need to calculate the difference between the date of the charge and the date the user picks in the slicer, which is connected to my date table.
I've tried the selectedvalue() and max() functions on my date table, but since the slicer is for dates up to the chosen date and not for one single date, selectedvalue() doesn't work, and when I compare using max(), the chosen date updates to the max(charge_date) for the particular row. So, if I choose 3/31 in the slicer but the charge date is 12/31, the max date becomes the same as the charge date, and everything falls into the current bucket. I tried dissociating the date table, but then selectedvalue() won't display at all and max() gives me the very latest date in the date table regardless of what I choose. Then, all the balances immediately go to the 120 bucket.
In my mind, what I want to do is set a variable equal to the date choice in the slicer. Then I can adjust everything in the report based on that variable. But Power Bi doesn't work that way. Does anyone have any suggestions? I can post screenshots if needed once I'm logged into my work PC.
Thank you in advance for your help.

create a Calendar table without any relation to your Transaction Table.
Keep the Date slicer and Choose After
From 01 to 29 days = CALCULATE([Due Amount]
,FILTER('BDW Account Receivable',DATEDIFF(min(Calender[Date]),'BDW Account Receivable'[DueDate],DAY)>-30
&& DATEDIFF(min(Calender[Date]),'BDW Account Receivable'[DueDate],DAY)<0))

Related

Power BI Real Time Scenario from Client

I want to my whole report to show data on latest month once data get's added. How to do in Power BI?
I tried at report level filter, Also I am expecting whether it can do from DAX
You can use a filter to limit the data displayed in your report to the latest month.
First, create a calculated column that extracts the month from the
date column in your data.
Next, add a filter to your report and choose the option to "filter by a relative date".
Set the filter to only show data where the month equals the maximum month extracted in step 1.
Once you have set the filter, your report will automatically show data for the latest month as new data is added to your dataset.
To refresh the report, you can right click on the report and select the refresh button
It's basic method you can use to filter by latest month

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?

Dynamic Column Values in Power BI

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.

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.