The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I want to get minimum customer order date between date range , if change date range then i should get minmum order date date between that range.
for the reference please refer ss.
i have used date slicer if i change date range i should get minimum to large date in that table for that particular date range and i want to add column which shows the is this minimum date or not for that particular range in the form of "Yes" and "No"
for example: my date range is 21 jan 2020 - 31 dec 2021
and in table im having dates like order dates like
23 jan 2020
26 jan 2020
28 jan 2020
30 dec 2021
....
so here my min date is 23 jan 2020 so i need to comapre this date with this column itself if it is matching i want "Yes" in next column otherwise "No" .
and this should be run as per change in date range
Solved! Go to Solution.
Hi @komald
you can try
Is First Order =
VAR CurrentDateInFilter =
SELECTEDVALUE ( Table[FactSales Posting Date] )
VAR FirstSelectedDate =
CALCULATE (
MIN ( Table[FactSales Posting Date] ),
REMOVEFILTERS (),
ALLSELECTED ( Table[FactSales Posting Date] )
)
VAR LastSelectedDate =
CALCULATE (
MAX ( Table[FactSales Posting Date] ),
REMOVEFILTERS (),
ALLSELECTED ( Table[FactSales Posting Date] )
)
VAR FirstOrderDate =
CALCULATE (
MIN ( Table[FactSales Posting Date] ),
Table[FactSales Posting Date] > FirstSelectedDate,
Table[FactSales Posting Date] < LastSelectedDate
)
RETURN
IF ( CurrentDateInFilter = FirstOrderDate, "Yes", "No" )
Hi @komald
you can try
Is First Order =
VAR CurrentDateInFilter =
SELECTEDVALUE ( Table[FactSales Posting Date] )
VAR FirstSelectedDate =
CALCULATE (
MIN ( Table[FactSales Posting Date] ),
REMOVEFILTERS (),
ALLSELECTED ( Table[FactSales Posting Date] )
)
VAR LastSelectedDate =
CALCULATE (
MAX ( Table[FactSales Posting Date] ),
REMOVEFILTERS (),
ALLSELECTED ( Table[FactSales Posting Date] )
)
VAR FirstOrderDate =
CALCULATE (
MIN ( Table[FactSales Posting Date] ),
Table[FactSales Posting Date] > FirstSelectedDate,
Table[FactSales Posting Date] < LastSelectedDate
)
RETURN
IF ( CurrentDateInFilter = FirstOrderDate, "Yes", "No" )
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |