Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I have a below query in oracle db and I want to replicate dense_rank functionality in power bi that returns same result in oracle but I don't know DAX much and still learning so posting question here. I want to create a measure in Power BI that is exaclty same as below hilighted oracle query. Attached is oracle sql and result of query for reference.
Could some one please help me here? Thank you in advance and appreciate your help!.
select
a12.YEAR_ID YEAR_ID,
a12.MONTH_ID MONTH_ID,
a13.MONTH_NAME MONTH_DESC,
(Max(a11.ENH_ACTIVE_COUNT) Keep (dense_rank Last order by a11.DATE_ID asc) + Max(a11.HELP_ACTIVE_COUNT) Keep (dense_rank Last order by a11.DATE_ID asc)) Total,
Max(a11.ENH_ACTIVE_COUNT) Keep (dense_rank Last order by a11.DATE_ID asc) Enhanced_Count,
Max(a11.HELP_ACTIVE_COUNT) Keep (dense_rank Last order by a11.DATE_ID asc) Help_Count
from PSR_FACTS a11
join RPT_PMATT_DEV.TIME_DIMENSION_DAY a12
on (a11.DATE_ID = a12.DATE_ID)
join TIME_DIMENSION_MONTH a13
on (a12.MONTH_ID = a13.MONTH_ID)
join TIME_DIMENSION_YEAR a14
on (a12.YEAR_ID = a14.YEAR_ID)
where a12.YEAR_ID in (2021,2022)
group by a12.MONTH_ID,
a13.MONTH_NAME,
a12.YEAR_ID,
a14.YEAR_DESC
Thank you,
Vpat
Solved! Go to Solution.
Thank you Grag for putting greate link about RANKX. I have achieved similar result by using Calculate function in DAX.
e.g.
@Patv Not an expert on Oracle and sql syntax but the RANKX function in DAX provides a Dense option. RANKX function (DAX) - DAX | Microsoft Docs
Thank you Greg. I tried to use RANKX function in Power Bi but since I am not expert in DAX, I was not able to figure it out hence I posted a question. Let's see if someone is able to help here. Thank you for your reply.
@Patv This might help you figure out RANKX: To *Bleep* with RANKX! - Microsoft Power BI Community
Thank you Grag for putting greate link about RANKX. I have achieved similar result by using Calculate function in DAX.
e.g.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
12 | |
11 | |
9 | |
6 | |
6 |