Forum Discussion
AS AT slicers
- 1 year ago
Hi Steve_M
As mentioned in my previous reply, filters coming from a related table will affect what records are visible. So if you select 28/11, you will see only the 28/11 rows. Functions such as ALL, ALLSELECTED, REMOVEFILTERS etc affect the results of a measure but cannot unhide the non-selected rows. Change your slicer to before if you want to also show rows with dates prior to the currently selected.
Hi Steve_M
Thank you for reaching out to Microsoft Fabric Community.
To address your issue, you need to ensure that the "As-At Date" slicer works without filtering the transaction lines table directly but still allows you to calculate the number of days open relative to the selected "As-At Date."
Here's how you can achieve it by using this below DAX query:
# Days Open AR =
VAR First_Date =
IF(
ISBLANK(MAX('Transaction Lines'[Due Date/Receive By])),
MAX('Transaction Lines'[Date]),
MAX('Transaction Lines'[Due Date/Receive By])
)
VAR AsAtDate =
SELECTEDVALUE('Date Dimension'[Date], TODAY()) -- Get the selected date or default to TODAY()
RETURN
DATEDIFF(
First_Date,
IF(AsAtDate > TODAY(), TODAY(), AsAtDate), -- Ensure the date doesn't exceed today's date
DAY
)
- Here the SELECTEDVALUE retrieves the date selected by the user from the slicer.
- If no date is selected, it defaults to TODAY().
- If the selected "as-at" date is in the future, it defaults to today's date to avoid discrepancies.
- The slicer does not filter out any transactions, ensuring accurate results.
This approach should meet your requirements and ensure accurate AR aging calculations for any selected date. Let me know if you need any further adjustments!
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Thanks and Regards,
Anjan Kumar Chippa