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 Team,
here i have column like Shipcity and duration and Geostop Count
for same driverkey i am getting two rows with same city name
for 170402 city HALIFIX duration 8.55 and 8.95 and count 12 and 8
i want to get only single city name like HALIFIX with sum of geostop count = (12+8 = 20) and duration = (8.55 +8.95= 17.5)
How to sum two rows for same driver key or city ?
Solved! Go to Solution.
Hi @Bhaskar123 ,
Please try below steps:
1. create two measure with below dax formula
Measure =
VAR cur_dk =
SELECTEDVALUE ( 'Table'[DriverKey] )
VAR cur_city =
SELECTEDVALUE ( 'Table'[ShipCity] )
VAR tmp =
FILTER (
ALL ( 'Table' ),
'Table'[DriverKey] = cur_dk
&& 'Table'[ShipCity] = cur_city
)
RETURN
SUMX ( tmp, [Geo Stop Count] )
Measure2 =
VAR cur_dk =
SELECTEDVALUE ( 'Table'[DriverKey] )
VAR cur_city =
SELECTEDVALUE ( 'Table'[ShipCity] )
VAR tmp =
FILTER (
ALL ( 'Table' ),
'Table'[DriverKey] = cur_dk
&& 'Table'[ShipCity] = cur_city
)
RETURN
SUMX ( tmp, [Duration] )
2. add a table visual with fields and measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Bhaskar123 ,
Please try below steps:
1. create two measure with below dax formula
Measure =
VAR cur_dk =
SELECTEDVALUE ( 'Table'[DriverKey] )
VAR cur_city =
SELECTEDVALUE ( 'Table'[ShipCity] )
VAR tmp =
FILTER (
ALL ( 'Table' ),
'Table'[DriverKey] = cur_dk
&& 'Table'[ShipCity] = cur_city
)
RETURN
SUMX ( tmp, [Geo Stop Count] )
Measure2 =
VAR cur_dk =
SELECTEDVALUE ( 'Table'[DriverKey] )
VAR cur_city =
SELECTEDVALUE ( 'Table'[ShipCity] )
VAR tmp =
FILTER (
ALL ( 'Table' ),
'Table'[DriverKey] = cur_dk
&& 'Table'[ShipCity] = cur_city
)
RETURN
SUMX ( tmp, [Duration] )
2. add a table visual with fields and measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Mahesh,
Thanks for replay,
here GeoStop count is Measure so we are unable to sum the measured values.
i have tried this approch but no luck
Hi @Mahesh0016
Thanks for replay,
here GeoStop count is Measure so we are unable to sum the measured values.
i have tried this approch but no luck
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |