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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I have a table with two text columns [Quarter] and [ID]. How I want to return the count of [ID] last quarter as below.
Here are the calculations used in the matrix.
Measure:
# of Opportunities = CALCULATE(COUNT(Opportunities[Id]))
Last Quarter = IF(VALUE(RIGHT(Opportunities[Quarter], 1)) = 1, VALUE(LEFT('Opportunities'[Quarter], 4) - 1) & " / Q4", LEFT('Opportunities'[Quarter], 😎 & VALUE(RIGHT('Opportunities'[Quarter], 1) - 1))Number of Opportunities Last Quarter = CALCULATE(COUNT('Opportunities'[Id]), FILTER('Opportunities', Opportunities[Quarter] = [Last Quarter]))
Solved! Go to Solution.
Hi Penn,
You could try to create a column like below(order quarter ace)
Then create a measure like beow
last q =
CALCULATE (
COUNT ( 'LAST QUARTRE'[ID] ),
FILTER (
ALL ( 'LAST QUARTRE' ),
'LAST QUARTRE'[Custom]
= MIN ( 'LAST QUARTRE'[Custom] ) - 1
)
)Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I think I better build a date table then...problem solved
Hi Penn,
You could try to create a column like below(order quarter ace)
Then create a measure like beow
last q =
CALCULATE (
COUNT ( 'LAST QUARTRE'[ID] ),
FILTER (
ALL ( 'LAST QUARTRE' ),
'LAST QUARTRE'[Custom]
= MIN ( 'LAST QUARTRE'[Custom] ) - 1
)
)Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Good idea!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 59 | |
| 51 | |
| 46 |