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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
PPStar
Helper V
Helper V

DAX Help. Rank or Filter

Hi, i have the following Measures

 

Usage - Consumer = var consumer = CALCULATE('Measures'[Usage - All], Activities[Role] = "Consumer")
Return
IF(ISBLANK(consumer),"0",consumer)
 
The UsageAll is just a count of the Audit Records. 
The Measure above is is just filter the count to show Consumer counts. This part all works fine. 
 
I then created another measure as below
Usage Consumer - Last Year = CALCULATE([Usage - Consumer], SAMEPERIODLASTYEAR(Dates[Date]))
 
This gives me the consumer usage for each workspace for the previous year. 
 
When i out the data into a matrix, i get the below
 
PPStar_0-1672916687312.png

 

(I have blurred out the workspace name values). 

 

I need to create a graph which shows the top 5 most used workspaces from the previous year.  On the Matrix above, i have all the data, but i need to sort it to only show the the top 5 workspaces for each month. So looking at the matrix above, you can see the top 5 would be 

 

Workspace 1 = 3419

Workspace 2 = 372

Workspace 3 = 182

Workspace 4 = 182

Workspace 5 = 106

 

I want to plot these 5 workspaces on a stacked chart to show their usage every month. 

 

How can this be acheived?

 

Thanks

3 REPLIES 3
PPStar
Helper V
Helper V

i need to find the top 5 workspaces per month, so the stacked graph needs to show me a stacked chart of 5 of the most users workspaces per month

amitchandak
Super User
Super User

@PPStar , try like

 

CALCULATE([Monthly measure],TOPN(5,all(Table[Workspace]),[Last year measure],DESC),VALUES(Table[Workspace])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I dont understand what you have done there.  What is [MonthyMeasure]

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.