cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sam_85
Frequent Visitor

RankX with Filter

Hi,
I was trying to build a RankX Forumla.
My Condtions are a Fact Table (Value,Date,ID,Company) and a Date Table (Date).
The Goal was a Ranking for the IDs for each company for each year for the values.
Is this possible?

Thought kinda like this...

=RANKX(_data_vo;
	CALCULATE(
		SUMX(_data_vo;[Wert]);
		FILTER(_data_vo;[company]=[company]);
		FILTER(_data_vo;[company_id]=[id]);
		FILTER(_data_vo;YEAR([Datum])=YEAR([Datum])));
	0;ASC;Dense)

 

Greetings

Sam

3 REPLIES 3
amitchandak
Super User IV
Super User IV

@Sam_85 , Try like

 

RANKX(filter(allselected(_data_vo);_data_vo;[company]=max([company]) && [company_id]=[id] && YEAR([Datum])=YEAR(max([Datum])))
CALCULATE(
SUMX(_data_vo;[Wert]));
0;ASC;Dense)

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

I was trying to made it like that

but i get a ring addiction...(i dropped out the max, but get the same message with max in formula)

 

 

 

=RANKX(
	FILTER(
		ALLSELECTED(_data_vo);
			[company]=[company]&&[company_id]=[company_id]&&YEAR([Datum])=YEAR([Datum]));
		CALCULATE(
			SUMX(_data_vo;[Wert]));
	0;ASC;Dense)

 

 

 

@Sam_85 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors