Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
Have searched all through the forums but I cant manage to crack this one.
I'm attempting to sum the total of 'Container'[HBLperConsol] for each distinct 'Container'[ConsolNum] filtered by the dates below.
The date filter is working, but the measure is returning the sum for every row that matches the date filter, as the 'Container'[ConsolNum] column contains duplicates.
DAX measure below:
CurrentWkHBL =
VAR CurrentYear =
YEAR( TODAY() )
VAR CurrentWeek =
WEEKNUM( TODAY(), 2 )
RETURN
SUMX(
DISTINCT( Container[ConsolNum] ),
CALCULATE(
SUM( Container[HBLperConsol] ),
YEAR( Container[ETA] ) = CurrentYear
&& WEEKNUM( Container[ETA], 2 ) = CurrentWeek
)
)
Any guidance would be greatly appreciated 🙂
Solved! Go to Solution.
Hi, @JRB
Please check the below picture and the measure.
If you want to stick to your measure, please try to replace sum with max, like below.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
Hi, @JRB
Please check the below picture and the measure.
If you want to stick to your measure, please try to replace sum with max, like below.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
Thank you @Jihwan_Kim
This solution works perfectly.
I'm now off to study the MAX vs SUM functions.
Regards,
Jordan
Hi,
Share some data, explain the question and show the expected result.
Hi Ashish,
Below some sample data:
The expected result for Asia should be 33 (12 + 7 + 14 - the sum HBLperConsol for each distinct value in Consol Num) But the measure is returning 12 + 12 + 7 + 14 - the sum of every value in HBLperConsol.
Hope this clarifies
Hi,
In the Query Editor, please ensure that HBLperConsol is a numeric column. Try this measure
=SUMX(VALUES(HBLperConsol),HBLperConsol)
Hope this helps.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
88 | |
49 | |
45 | |
38 | |
37 |