Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi everyone,
I am having a bit of trouble to sum up top 3 categories with highest revenue only for the most current year.
So far, I have the measure for the ranking part, and I have a measure that can filter out the data only to the current year but the problem is I can't merge these 2 measures to get me the output I am expected.
Ranking measure:
RANKX( ALLSELECTED(company[industry]), CALCULATE( SUM(table1[revenue1]) + SUM(table1[revenue2]))
, , DESC, Dense)
Filtering to current year:
FILTER(
ALL(table1),
table1[rev_year].[Year] = MAX(table1[rev_year].[Year])
&& table1[rev_year].[Date] <= MAX(table1[rev_year].[Date])
I want to create a measure which can help me to get top 3 industries with highest revenue but only based on the current year. Any suggestion?
Solved! Go to Solution.
Try fix this:
I assume you have a date table, edit:
var a = max(date.[year])
return
RANKX( ALLSELECTED(company[industry]), CALCULATE(SUM(table1[revenue1]) + SUM(table1[revenue2]),table1[rev_year]=a)I tried by using this sample data and it workd
I think you need only one DAX, using condition in calculate function. Try something like this:
var a = max(table1[rev_year].[year])
return
RANKX( ALLSELECTED(company[industry]), CALCULATE(SUM(table1[revenue1]) + SUM(table1[revenue2]),table1[rev_year].year=a), , DESC, Dense)
Hi @Adam_Shelton ,
Thank you for your respond. I tried the suggested measure but the output I received is as below:
Try fix this:
I assume you have a date table, edit:
var a = max(date.[year])
return
RANKX( ALLSELECTED(company[industry]), CALCULATE(SUM(table1[revenue1]) + SUM(table1[revenue2]),table1[rev_year]=a)I tried by using this sample data and it workd
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |