cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Rankx giving incorrect results on applying visual filter

Hi Everyone, 

 

I have below requirement to achieve. I have done all the steps but stuck with below problem. Could you please help?

 

1. I am summing up first impact and second_impact over Start_date, location, headline, Unit and then showing only the row having max Plan Code.

2. Then I have added a column Total Impact which is First_impact + Second_impact and then sorted the data as per Total impact.

3. I need to show the Top N records according to Total impact column and add a rank column.

4. I have added Rank column which shows rank as user selection from Top N slicer. 

 

Problem  -->>   The problem I am facing is that I am seeing the rank as per Top N selection but other all other rows are also visible with blank Total Impact values. I tried putting a Visual Filter (where Total Impact is not blank) but then it give incorrect values. **** Please note, the First_impact and Second_impact are being calculated on other slicer selections ****

 

Data I have:

 

Start_datePlanPlan CodeLocationheadlineUnitPriorityFirst_impactSecond_impact
01-Jan-21Dom15Site_1Air limitD_Other GDCFALSE00.47
01-Jan-21Planned10Site_1This is heaterMy_PokerTRUE0.060
01-Jan-21Test Planned8Site_1This is heaterMy_PokerFALSE0.010
01-Jan-21Unplanned5Site_2limitations trainGe_B12TRUE0.020
01-Jan-21Planned10Site_2safety regulationGe_CycleFALSE0.040
01-Mar-21Unplanned5Site_1limitations trainGe_B12FALSE0.020.01
01-Mar-21Planned10Site_1limitations trainGe_B12TRUE0.030.04
01-Mar-21Unplanned5Site_1limitations trainGe_B12FALSE0.010.01
02-Apr-21Planned10Site_2safety regulationMy_PokerFALSE23
02-Apr-21Dom15Site_2safety regulationMy_PokerTRUE51

 

 

 

Expected output:

 

RankStart_datePlanPlan CodeLocationheadlineUnitPriorityFirst_impactSecond_impactTotal Impact
102-Apr-21Dom15Site_2safety regulationMy_PokerTRUE7411
201-Jan-21Dom15Site_1Air limitD_Other GDCFALSE00.470.47
301-Mar-21Planned10Site_1limitations trainGe_B12TRUE0.060.060.12
401-Jan-21Planned10Site_1This is heaterMy_PokerTRUE0.0700.07
501-Jan-21Planned10Site_2safety regulationGe_CycleFALSE0.0400.04
601-Jan-21Unplanned5Site_2limitations trainGe_B12TRUE0.0200.02

 

 

Best Regards,

Sumit

 

 

@amitchandak @v-chenwuz-msft @MSFT_JT @Fowmy 

1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@Anonymous  There is a way to return the sum of TOPN and Ranking of TOPN through custom measures. You definitely need to adapt that to your scenario. But atleast it gives you the idea how to do it. The pbix is attached.

 

 

smpa01_0-1635659324958.png

 

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






New Animated Dashboard: Sales Calendar


View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@smpa01 Apologies for my late response, I was on holiday.

 

The solution you provided works absolutely fine. Thanks heaps for your support, much appreciated 🙂

 

 

 

smpa01
Super User
Super User

@Anonymous  There is a way to return the sum of TOPN and Ranking of TOPN through custom measures. You definitely need to adapt that to your scenario. But atleast it gives you the idea how to do it. The pbix is attached.

 

 

smpa01_0-1635659324958.png

 

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






New Animated Dashboard: Sales Calendar


@Anonymous  did you try the above ?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






New Animated Dashboard: Sales Calendar


lbendlin
Super User
Super User

You may want to read this article

 

Use of RANKX in Power BI measures - SQLBI

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors