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

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.

Reply
Anonymous
Not applicable

Card visual with Filter rankx specific

Hi,

 

I am stuck pulling this 43.3 calculation out with a rank filter added into it. Can someone help me put it into a card?

 

43.343.3

 

 

 

 

 

 

 

 

 

 

 

 

 

Like a filter like this?

,

filter(Tech,[RankX Tech Flat Rate] =1)

 

Here is my Formula that is calculating this number:

 

CalculationCalculation

 

 

 

 

1 ACCEPTED SOLUTION

@Anonymous Are you wanting each employee to have ranked goals 1-N by location for the date selected (ie today)??

 

Is your Tech table a unique table for employee key? 

 

If you can draw out your desired result with some sample data for about 3 employees over 5 days then I'll understand 100% what you need, but right now I'm still wrapping my head around the requirement. 

 

You may need to use the KEEPFILTERS() function inside your RANKX, but if your Tech table is an employee table and location and Dates are in separate tables then you may not need that step....


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

AllisonKennedy
Super User
Super User

@Anonymous I don't really know what you're asking yet and you need to provide all the DAX please, including for those measures within measures such as [Gap_value] 

 

Depending what you want, it could be as simple as: 

 

Filtered Measure = CALCULATE( [Flat Rate Gap to Budget, WD Daily] , filter(Tech,[RankX Tech Flat Rate] =1) )

 

Or may be more complex such as using AVERAGEX: 

 

Filtered Measure = AVERAGEX( filter(Tech,[RankX Tech Flat Rate] =1),  [Flat Rate Gap to Budget, WD Daily]  )

 

or something else entirely, but need more info on what you're looking for in that case.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Hi Allison,

 

Thanks for getting back to me. Here is some more information on the problem I am having and trying to solve. I know I am very close to getting what I need, just not sure what I am missing.

 

I have this calculation that pulls from 3 different tables (Fact Table, Budget table, Dates Table).

 

Gap to Budget, Daily Calc = divide(([Budget] - [Actuals]),[Working Days Left, MTD],0)

 

In order to get the employee their goal for the day. I want to Rank the highest goal for the day, by location, and is today.  My Ranking Calculation is:

 
Rankx By Goal =
Rankx(
All(
Tech[Tech]),
[Flat Rate Gap to Budget, WD Daily]
)

 

I know I probably have to call a virtual table then do a Max or Min Date to call the lastest date for this calculation. Here is my dalily goal Calculation that gives me the latest day in a visual card, but I can't seem to filter by my ranking measure  and have it be dynamic. 

 

Flat Rate Gap to Budget, WD Daily =
Var Gap_Table = summarize(Dates,Dates[Date],"Gap_value",[Gap to Budget, Daily Calc])
Return
if(HASONEVALUE(Dates[Date]),[Gap to Budget, Daily Calc],MINX(Gap_Table,[Gap_value])
)

 

 

Do you think you can help with this part?

 

Thanks so much,

Trevor

 

@Anonymous Are you wanting each employee to have ranked goals 1-N by location for the date selected (ie today)??

 

Is your Tech table a unique table for employee key? 

 

If you can draw out your desired result with some sample data for about 3 employees over 5 days then I'll understand 100% what you need, but right now I'm still wrapping my head around the requirement. 

 

You may need to use the KEEPFILTERS() function inside your RANKX, but if your Tech table is an employee table and location and Dates are in separate tables then you may not need that step....


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

@AllisonKennedyThanks for your time!

 

 

Well, what I ultimately need is to use cards for different information that are referenced to a certain employee, but also have that be dynamic so if the employee moves location or Role that all the information will be correct for that specific employee. Thats why I wanted to have a rank calculation, but I am having trouble filter by that ranking.

 

I thought it would be best to rank based off the budget number and then give them a ranking for all the data and sort categories to reference.

 

Its tough because they are all in different tables. The Actuals, Budget, Dates, Techs, Location, Role, Clock Times.

 

Here is the data I am trying to use and card setup I'd like. I'd like it to be able to sort by Today or by Month. Data ExampleData Example

 

Here are the main Calculations used to get this data.

 

Forecasting CalcForecasting CalcHasone Value for CardHasone Value for Card

Rank Order CalcRank Order Calc

 

Then, When I sort by a Single day the Today's Goal Doesnt pull in the specific correct goal for each employee with the Rank Function calculation. It just gives the total.

 

Single Day DataSingle Day Data

Anonymous
Not applicable

@AllisonKennedy I found a solution over the weekend. Looks like I just needed to add the measure into Calculate with the filter rank like you originally said. Thanks again!

 

1st =
Calculate(
[today's goal],
filter(Tech,[RankX by Actual] =1))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.