Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
I'm having trouble creating a measure that will behave in the following manner:
Existing Measures(#) > If the sum of that measure for each month is > 2000 then limit to 2000, else if < -2000 then limit to -2000 > Find the Sum based on the given date slicer and visual context
To my understanding, I need some way to calculate the of each month with the [NetRevenue wLimit] applied before it aggregates by Yearmonth. I'm not sure how to achieve this behavior. The examples below show I get the expected result when only one month is selected, but when I add multiple months in my date slicer the measure doesn't behave as desired.
My guess is I need to use some type of iterator function(SUMX...), but I can't get anything to work.
Expected Result: (Month Date Slicer)[June and July Selected]
SalesRepName | Net Revenue $ | NetRevenue wLimit |
Bob | 200 | 200 |
Susan | -4000 | -3000 |
What I getting instead [Month Date Slicer](June and July Selected)
SalesRepName | Net Revenue $ | NetRevenue wLimit |
Bob | 200 | 200 |
Susan | -4000 | -2000 |
If I expand the table to include year month the evaluated table looks like the following
SalesRepName (Column) | YearMonth(Column) | Net Revenue $ (Measure) | NetRevenue wLimit (Measure) |
Bob | 202106 | -1 | -1 |
Bob | 202107 | 201 | 201 |
Susan | 202106 | -1000 | -1000 |
Susan | 202107 | -3000 | -2000 |
Measure Definitions:
Net Revenue $ = ([Ending Book] - [Starting Book])
*Note [Ending Book] and [Starting Book] are both calculated measures using the credits table
NetRevenue wLimit =
VAR MC =
CALCULATE (
SUM ( Credits[Amount] ),
Credits[Credit Type] = "Management Change Add"
|| Credits[Credit Type] = "Management Change Add Term"
|| Credits[Credit Type] = "Management Change Drop Term"
|| Credits[Credit Type] = "Management Change Drop"
)
RETURN
IF ( MC > 2000, 2000, IF ( MC < -2000, -2000, MC ) )
Model:
Other information:
Salesrepname sourced from the historical salesroletable
Yearmonth is from the Dimension vw_Date table
Solved! Go to Solution.
Yeah, the idea is to iterate at the level of granularity that your limit rules apply. It will look something like this:
Revenue with Limit =
SUMX (
ADDCOLUMNS (
SUMMARIZE (
Credits,
Credits[SalesRepName],
vw_Date[YearMonth]
),
"@MC", [MC Limit]
),
[@MC]
)
Yeah, the idea is to iterate at the level of granularity that your limit rules apply. It will look something like this:
Revenue with Limit =
SUMX (
ADDCOLUMNS (
SUMMARIZE (
Credits,
Credits[SalesRepName],
vw_Date[YearMonth]
),
"@MC", [MC Limit]
),
[@MC]
)
Thank you @AlexisOlson. Could you explain what the "@" simple means and where I can learn more about iterator functions?
The @ symbol is just a naming convention for a temporary column. It's not an operator or special symbol. You could remove it and it wouldn't change how the measure works.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 77 | |
| 37 | |
| 31 | |
| 29 | |
| 26 |