Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have selected Two months : Jan and Feb , Now i have a measure "Max Trip"
Now i hava measure trip_prev which shows the Max trip of least month selected:
Solved! Go to Solution.
Hi @Samarth-Borade,
You can try to add a variable to compare the current and previous month and use it as condition in your formula to exclude same month scenarios:
Same Route =
VAR MinDate =
MIN ( MV_QKM_DATA[Trip Date] )
VAR MaxDate =
MAX ( MV_QKM_DATA[Trip Date] )
VAR _minTrip =
CALCULATE (
[Max Trip],
FILTER (
MV_QKM_DATA,
YEAR ( MV_QKM_DATA[Trip Date] ) = YEAR ( MinDate )
&& MONTH ( MV_QKM_DATA[Trip Date] ) = MONTH ( MinDate )
)
)
VAR _maxTrip =
CALCULATE (
[Max Trip],
FILTER (
MV_QKM_DATA,
YEAR ( MV_QKM_DATA[Trip Date] ) = YEAR ( MaxDate )
&& MONTH ( MV_QKM_DATA[Trip Date] ) = MONTH ( MaxDate )
)
)
VAR flag =
IF (
YEAR ( MinDate ) * 100 + MONTH ( MinDate )
= YEAR ( MaxDate ) * 100 + MONTH ( MaxDate ),
"Y",
"N"
)
RETURN
IF (
flag = "N"
&& _minTrip = _maxTrip,
SELECTEDVALUE ( MV_QKM_DATA[Route Path] )
)
Regards,
Xiaoxin Sheng
Hi @Samarth-Borade,
You can try to add a variable to compare the current and previous month and use it as condition in your formula to exclude same month scenarios:
Same Route =
VAR MinDate =
MIN ( MV_QKM_DATA[Trip Date] )
VAR MaxDate =
MAX ( MV_QKM_DATA[Trip Date] )
VAR _minTrip =
CALCULATE (
[Max Trip],
FILTER (
MV_QKM_DATA,
YEAR ( MV_QKM_DATA[Trip Date] ) = YEAR ( MinDate )
&& MONTH ( MV_QKM_DATA[Trip Date] ) = MONTH ( MinDate )
)
)
VAR _maxTrip =
CALCULATE (
[Max Trip],
FILTER (
MV_QKM_DATA,
YEAR ( MV_QKM_DATA[Trip Date] ) = YEAR ( MaxDate )
&& MONTH ( MV_QKM_DATA[Trip Date] ) = MONTH ( MaxDate )
)
)
VAR flag =
IF (
YEAR ( MinDate ) * 100 + MONTH ( MinDate )
= YEAR ( MaxDate ) * 100 + MONTH ( MaxDate ),
"Y",
"N"
)
RETURN
IF (
flag = "N"
&& _minTrip = _maxTrip,
SELECTEDVALUE ( MV_QKM_DATA[Route Path] )
)
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
17 | |
10 | |
10 | |
8 | |
6 |
User | Count |
---|---|
18 | |
16 | |
15 | |
12 | |
10 |