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!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |