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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
u035546
Frequent Visitor

Calculation based on top3 dates

Hello all. I am struggling with this calculation.

 

u035546_0-1687860868137.png

I have these three columns in the same query.

Of course there are more rows.

What I cannot do is COUNT the number of "Overall evaluation 0-4" corresponding to the TOPN 3 "Data prelievo" dates for each "Caratteristica".

 

I expect as output a visual table with two columns: 1) the counted number and 2) the date, on three rows only BTW.

 

 

What I have tried so far is a measure like:

 

CALCULATE(COUNT([Overall evaluation 0-4]) , [Caratteristica]="Durezza" , TOPN(3 , 'query/table name' , [Data prelievo] , DESC))

 

I can get the "Caratteristica" filtered, but never the top 3 related dates. Everytime I have all the existing dates as result and not only the first 3 rows. Note: I ain't looking fot the absolute last 3 dates in the table, I need the last 3 related to the column "Caratteristica".

 

Only for the record, I know for sure that there is only 1 value of "Overall ev." for a single day / date. It's a crosscheck that I need to do thus I cannot perform it by PBI built in filters.

 

Thanks in advance

0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.