Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
48 | |
19 | |
13 | |
11 |