Forum Discussion
Show only the second ranked value for a Monthly Graph
Hi there.
With the advanced filter "First N" I can show the First N values by a measure.
For example, I can show the First 3 production lines based on qty produced.
According to this, I'm able to show the first one or the last one value.
But what if I need to show ONLY the second value (or third, ecc)? I have to build 3 graphs about the monthly trend of a measure, with data related to:
-the first one value (e.g. the first line)
-the second one
-the third one.
Take in mind that build 3 graph is, in this case, mandatory. I cant play with slicers because i'm building a printable report.
edit: I've tried with RANKX() function and it works quite fine, but I have a problem. If I put the month, then the graph shows me the ranked value of that month:
In this image, each color is a production line. I guess that the solution here is to create a measure with the sum of the qty produced for the year, but I have more than one year in my database. How can I, in a new measure, summarize the qty produced based on year?
3 Replies
- ribisht17
Super User
hI andreazambon
You can use RANK function here
Here is my video on the same > https://www.youtube.com/watch?time_continue=2&v=ckR46zdNexk&embeds_referring_euri=https%3A%2F%2Fwww.google.com%2F&source_ve_path=Mjg2NjY&feature=emb_logo
>>https://learn.microsoft.com/en-us/dax/rank-function-dax
Once you have this , then you just need to filter rank=2
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !! PL 300 Certification Series- andreazambon
Helper V
Yes, I figured it out but i have a problem which is explained in my first post.
- andreazambon
Helper V
Hello guys, I have un update:
I succesfuly ranked my production lines based on YTD qty produced.
Now I would like to see in three distinct graphs the causes of scrap of the first, second and third ranked line.
The issue is that if I put this informations in a graph it shows me the second line FOR EACH scrap cause and that's not the goal. I need the top7 causes for the second line in order by qty produced, and so on.
Should I make a measure which output is the ranked line? This means 3 new measures... not a good example of flexibility, doesn't it? 😛
Any ideas?
Thanks