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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have created a VAR of top N table of customers and, got one column of the desired customers,
however, when I try to calculate a sum of sales (which is called [QoQ Variance]), using an "IN" statement it won't work.
top20Customer =
VAR topNTable =
TOPN (
20,
SUMMARIZE ( 'Dataset', 'Dataset'[CustomerID] ),
CALCULATE (
SUM ( 'Dataset'[QoQ Variance] ),
DATESBETWEEN (
'Dataset'[Current Period],
DATE ( 2019, 02, 01 ),
DATE ( 2021, 01, 01 )
),
MONTH ( 'Dataset'[Current Period] ) IN { 3, 6, 9, 12 },
'Dataset'[RetentionCategory] = "Increase"
)
)
RETURN
CALCULATE (
SUM ( 'Dataset'[QoQ Variance] ),
'Dataset'[CustomerID] IN topNTable
)
Solved! Go to Solution.
Maybe:
RETURN
CALCULATE (
SUM ( 'Dataset'[QoQ Variance] ),
INTERSECT( VALUES( 'Dataset'[CustomerID]), topNTable
))
or directly
RETURN
CALCULATE (
SUM ( 'Dataset'[QoQ Variance] ),
topNTable
)
Proud to be a Super User!
Paul on Linkedin.
Maybe:
RETURN
CALCULATE (
SUM ( 'Dataset'[QoQ Variance] ),
INTERSECT( VALUES( 'Dataset'[CustomerID]), topNTable
))
or directly
RETURN
CALCULATE (
SUM ( 'Dataset'[QoQ Variance] ),
topNTable
)
Proud to be a Super User!
Paul on Linkedin.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |