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
Hi everyone
I have the following 2 DAX formulas
1) HC Current Quarter =
VAR _maxdate = MAX('Headcount'[Date])
RETURN CALCULATE([Headcount],'Calendar'[Date] = _maxdate)
And
2)
hi @TJI7746 ,
try like:
@TJI7746 Hi! Try with:
HC Current Quarter =
VAR _maxdate = MAX('Headcount'[Date])
RETURN
IF(
HASONEVALUE('Calendar'[Date]),
CALCULATE([Headcount], 'Calendar'[Date] = _maxdate),
SUMX(
SUMMARIZE(
'Headcount',
'Calendar'[Date],
"HC", CALCULATE([Headcount], 'Calendar'[Date] = _maxdate)
),
[HC]
)
)
HC Previous Quarter =
VAR _maxdate = MAX('Headcount'[Date])
VAR _prevq = CALCULATE(
MAX(Headcount[Date]),
FILTER(ALL('Headcount'), Headcount[Date] < _maxdate)
)
RETURN
IF(
HASONEVALUE('Calendar'[Date]),
CALCULATE([Headcount], 'Calendar'[Date] = _prevq),
SUMX(
SUMMARIZE(
'Headcount',
'Calendar'[Date],
"HC", CALCULATE([Headcount], 'Calendar'[Date] = _prevq)
),
[HC]
)
)
BBF
This didn't work unfortunately 😞
Hi @TJI7746 ,
I think you can try SUMX() function to sum the measures to get correct result in subtotal.
HC Current Quarter (New) = SUMX(SUMMARIZE(Headcount,Headcount[Area],Headcount[SF Legal Gender]),[HC Current Quarter])HC Previous Quarter (New) = SUMX(SUMMARIZE(Headcount,Headcount[Area],Headcount[SF Legal Gender]),[HC Previous Quarter])
If this reply still couldn't help you solve your issue, please share a sample file with us.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 20 | |
| 13 | |
| 12 |