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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
PBI-Curious
Resolver I
Resolver I

Dax error message - Special flag is not allowed as an argument number 3 function RANKX

PBI Community Good Day!

 

I'm trying to create a dax measure that ranks the top 10 products by revenue_amount_usd

 

Need to solve for the error message below.

 

Much appreciated your time.

 

Thank you

 

PBICurious_1-1696966654740.png

 

 

PBICurious_0-1696965885694.png

 

1 REPLY 1
DallasBaba
Super User
Super User

@PBI-Curious Let replace the VALUES function with SUMMARIZE to create a table that includes the 'product' column and the calculated 'TotalRevenue' column.

 

Top 10 Products by Revenue =
CONCATENATEX(
TOPN(
10,
SUMMARIZE(
'revenue_prelim_data',
'revenue_prelim_data'[product],
"TotalRevenue", CALCULATE(SUM('revenue_prelim_data'[revenue_amount_usd]))
),
[TotalRevenue], DESC
),
'revenue_prelim_data'[product],
",",
[TotalRevenue]
)

 

Please let me know if that works.

 

Thanks

Best Regards,
Dallas.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.