Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi community,
I need calculate a measure with sum the column "Value" over the date filtered, if the Flag = B. I will use this measure in a table vision. For exemplify, I will use this datas:
Date | Flag | Item | Group | Subgroup | Value |
jan/20 | A | 0001 | GROUP1 | SG1 | 10 |
jan/20 | A | 0002 | GROUP1 | SG1 | 20 |
jan/20 | B | 0001 | GROUP1 | SG1 | 15 |
jan/20 | B | 0002 | GROUP1 | SG1 | 22 |
feb/20 | A | 0001 | GROUP1 | SG1 | 18 |
feb/20 | B | 0002 | GROUP1 | SG1 | 13 |
feb/20 | B | 0001 | GROUP1 | SG1 | 30 |
mar/20 | A | 0001 | GROUP1 | SG1 | 30 |
mar/20 | A | 0002 | GROUP1 | SG1 | 21 |
mar/20 | B | 0001 | GROUP1 | SG1 | 19 |
If I filter in slice the dates jan/20 and feb/20, I need the result bellow in the table visual:
Date | Flag | Item | Group | Subgroup | Value | NewValue |
jan/20 | A | 0001 | GROUP1 | SG1 | 10 | 80 |
jan/20 | A | 0002 | GROUP1 | SG1 | 20 | 80 |
jan/20 | B | 0001 | GROUP1 | SG1 | 15 | 80 |
jan/20 | B | 0002 | GROUP1 | SG1 | 22 | 80 |
feb/20 | A | 0001 | GROUP1 | SG1 | 18 | 80 |
feb/20 | B | 0002 | GROUP1 | SG1 | 13 | 80 |
feb/20 | B | 0001 | GROUP1 | SG1 | 30 | 80 |
Just explaining, the value is 80 because the lines with flag B in this filtered period has the values: 15 + 22 + 13 + 30. If I filter jan/20 to mar/20 the new value will be 99 and the lines of mar/20 must appear in table.
Anyone help me in this case?
Tks!! 🙂
Please try this measure expression
Total B Flags =
CALCULATE (
SUM ( 'Table'[Value] ),
ALLSELECTED ( 'Table' ),
'Table'[Flag] = "B"
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
something like this:
var f = selectedvalue(flag)
return calculate (sum(value),filter(allselected(),f="B"))
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
7 | |
5 | |
4 | |
3 |
User | Count |
---|---|
12 | |
11 | |
9 | |
8 | |
8 |