March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Experts,
I need help in showing dates only from selected range on the date slicer.
For example in the following snapshot of my fortnightly report, I expect the report to display only the records highlighted in yellow( as the Period selected is between 8/4/2019 to 5/5/2019)
Thanks in advance,
Meena
Solved! Go to Solution.
Just check if can create two more variables using MINX, MAXX - https://docs.microsoft.com/en-us/dax/minx-function-dax,
Use the filter example and find the min week start date when min week start date > Start_date of the slicer. Same way Max
You can try the use of slicer from here
https://medium.com/chandakamit/power-bi-comparing-data-across-date-ranges-36be49b68613
Thanks @EVEAdmin and @amitchandak for your response.
Though the links are very useful, but i can't figure out how can i implement the solution in my scenario.
So, basically I have a table called 'Emp', that I get employees fortnightly payments from. I created a non related table called 'Dim week ending' with DAX- ALLSELECTED(Emp[Period_end_date]. Then I created a measure to calculate fortnightly payments as following:
Total fortnightly payment =
VAR _lastdate =
CALCULATE (
MAX ( 'Dim week ending'[Period End Date] ),
FILTER (
ALLSELECTED ( 'Dim week ending'[Period End Date] ),
'Dim week ending'[Period End Date] < MAX ( 'Dim week ending'[Period End Date])
)
)
RETURN
IF (
MAX ( 'Dim week ending'[Period End Date] ) <= MAX ( ‘Emp’[Period End Date]),
CALCULATE (
SUM ( ‘Emp’ [Amount] ),
FILTER (
ALL (‘Emp’ [Period End Date] ),
‘Emp’ [Period End Date] <= MAX ( 'Dim week ending'[Period End Date])
&& ‘Emp’ [Period End Date]> _lastdate
)
)
)
I would highly appreciate if you can tell me where to include the logic for displaying only the fortnightly periods selected from the date range slicer.
Thanks,
Meena
The table shown in the first example may work like this
Measure1 = var MIN_SLICER_DATE = MIn(Silcer(DATE)) var MAX_SLICER_DATE = MAX(Silcer(DATE)) CALCULATE ( SUM ( ‘Emp’ [Amount] ), ‘Emp’ [Period End Date] >= MIN_SLICER_DATE && ‘Emp’ [Period End Date] <=MAX_SLICER_DATE )
But if the weekend date need to be calculated then more logic is needed
Just check if can create two more variables using MINX, MAXX - https://docs.microsoft.com/en-us/dax/minx-function-dax,
Use the filter example and find the min week start date when min week start date > Start_date of the slicer. Same way Max
thanks @amitchandak , I don't want to disrupt my current logic of fortnight end date. Any way I can include the min & max date seprately? or perhaps merge it with existing logic?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
127 | |
82 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |