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 ,
You could try below code:-
# 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 Selected_Date =
CALCULATE(
MAX('Transaction Date'[*Date (trans)]),
ALLSELECTED('Transaction Date')
)
VAR Second_Date =
IF(
Selected_Date > TODAY(),
TODAY(),
Selected_Date
)
RETURN
DATEDIFF(First_Date, Second_Date, DAY)
It would be very helpful if you could share the sample data and the required output to answer more specifically.
- Steve_M1 year agoFrequent Visitor
Thanks Samarth, I still get the same result. Below is what I am trying to achieve; when the date selected is, say, the 28th Nov, I want to calculate using that date. If the date selected is 31st Dec, which is greater than today, then use today's date. You can see in the debug slicer that the code to calculate the second date is working, but when it is used in the visual with filtering turned off, the MAX returns the max of the date table and not the date selected. I don't even know if this is possible. Working with a Live connection is making it hard but it what I have to deal with
- danextian1 year agoSuper User
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.
- Steve_M1 year agoFrequent Visitor
Thank you, I think this will work with Samarth's code.