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.
This is what my data looks like:
Please note this is just for category A. I have other categories as well. But all of them have channels and date and total orders etc. I want to calculate weekly sum for each category. However, I want to discount channel. I would like to show it in visual but the value of sum should be constant for all.
In the above case. 524+532+499+412+617 = 2584
I have this DAX:
Weekly Notification Sum =
VAR _max = MAXX(all(Consolidated), Consolidated[ Channel])
VAR _min = MAXX(ALL(Consolidated), Consolidated[Channel])
RETURN
CALCULATE(
SUM(Consolidated[Nudges]),
FILTER(Consolidated, Consolidated[ Channel] = _min || Consolidated[ Channel] = _max )
)
This one ofcourse doenst give me correct value. It takes max of each channel and then gives me that.
Tried many things but I am extremely clueless.
Edit:
This solution works fine until I add another column Channel into context.
Weekly Notification Sum =
VAR _Distinct_ =
SUMMARIZE (
Consolidated,
Consolidated[Type],
Consolidated[Date],
Consolidated[Total notifications]
)
RETURN
SUMX ( _Distinct_, Consolidated[Total notifications] )
To avoid counting the value multiple times, you can group the relevant columns before summing.
For example:
Weekly Notification Sum =
VAR _Distinct_ =
SUMMARIZE (
Consolidated,
Consolidated[Type],
Consolidated[Date],
Consolidated[Total notifications]
)
RETURN
SUMX ( _Distinct_, Consolidated[Total notifications] )
How do I make it not get affected by channel in the visual? When I add Channel it shows a different sum for each channel. I want it to show 2584 for all channels.
One approach would be to remove all filter context except the columns you're summarizing.
Try this, for example:
Weekly Notification Sum =
VAR _Distinct_ =
CALCULATETABLE (
SUMMARIZE (
Consolidated,
Consolidated[Type],
Consolidated[Date],
Consolidated[Total notifications]
),
ALLEXCEPT (
Consolidated,
Consolidated[Type],
Consolidated[Date],
Consolidated[Total notifications]
)
)
RETURN
SUMX ( _Distinct_, Consolidated[Total notifications] )
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 |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |