Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

count based on measure results

Hi 

I need your help in returning the count of instances based on the results of a measure

 

the first measure i have , counts if there is a rating at any point in time . the ratings are by team and have a start and end date . the rating changes over time 

 

ratings count = 

var min_date = calculate(lastdate(date_table([date]))

var max_date = calculate(max(date_table([date]))

var result = countrows([rating]), ratings_table[start_date]<=max_date , ratings_table[end_date]>=min_date, removefilters(date_table))

return result

 

the second measure , compares the result of ratings count to previous quarter 

 

vs_prvs_qtr =

var prvs_qtr=calculate([ratings_count], previousquarter(date_table[date]))

var diff = ratings_count-prvs_qtr

 

what i want to get is the total number of instances where diff is equal to -1 or 1 

i can get it to work at a team level , but not a total level.

 

 

1 REPLY 1
lbendlin
Super User
Super User

"var min_date = calculate(lastdate(date_table([date]))"

 

did you mean firstdate() ?

 

Please provide more context. It is unclear what you mean by instances.  Please provide sample data in usable format (not as a picture) and show the expected outcome.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.