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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi everyone,
i like to count the total number of accounts whose lastinvoicedatefirstdate for each of the rows.
for example if i select selected period to be 12 months, then if the current row is 2023 january, i want it to count the total number of acounts found in 2022 january.
context
the idea is that if i am looking at 2023 january. then if an account whose last transaction with us is more than the selected period. which means that they have no activity at all from the last period to now, then we have deemed the account as a lost account.
i have this code but it keeps showing a blank in the table visual.
@learningOh , Try like
test3 =
var currentdates = LASTDATE('FACT'[key(calendarfirstdate)])
var lastpdate = Date(Year(currentdates),month(currentdates)-1*[Selected Period] ,day(currentdates))
return
CALCULATE(DISTINCTCOUNT('FACT'[account num]),FILTER('FACT',
'FACT'[lastinvoicedatefirstdate]= lastpdate))
also refer
Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.