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.
Hi,
I have to get top 2 tasks by month starting from august 2017-now. When I'm using the top n filter it's giving me common top 2 tasks for all the months. I need top 2 tasks for that particular month.
Data source looks something like this:
Solved! Go to Solution.
Hi @tulsi
You may try to add a rank measure as below. Then drag it to visual level filter and set the measure is less than or equal to 2. If it is not your case, please share some data sample.
Rank = RANKX ( ALL ( Table[task name] ), CALCULATE ( SUM ( Table[Qty] ) ) )
Regards,
Cherie
First create the measure based on your required field:
measure_new = CALCULATE(SUM(TableName[Amount]),ALLEXCEPT(TableName, TableName[ID]))
Then create another measurethat will be used in the filtering section (Top N lest say countries)
RANK=RANKX(ALLSELECTED(TableName),[measure_new],,DESC,Dense)
Finally, create a table object, select the [ID], measure [measure_new] as value levels. Add the measure [RANK] as Visual level Filters, let the RANK value is less than or equals to 2.
So the measures that I have created are;
Measure1 = CALCULATE(SUM('all'[Qty]),ALLEXCEPT('all','all'[Task Name]))
Measure 2 = RANKX(ALLSELECTED('all'),[Measure1],,DESC,Dense)
and I created a table just like you mentioned with the filters i'm getting something like this:
But I need to get top 2 tasks for that particular month, here it's just showing overall top 2 tasks
I think the measure:
Measure1 = CALCULATE(SUM('all'[Qty]),ALLEXCEPT('all','all'[Task Name]))
needs to be different.
Sum('all[Qty]) needs to be count of task names and 'all'[Task Name] needs to be 'all'[Months]
and the table needs to have the months as dimension and the measure1 and add RANKX on Visual Filters
For some reason i'm not getting the desired result. I tried using your formula but i'm getting something like this:
Measure1 = CALCULATE(COUNT('all'[Task Name]),ALLEXCEPT('all','all'[month]))
Measure 2 = RANKX(ALLSELECTED('all'),[Measure1],,DESC,Dense)
Do you have any other solution?
I dont really understand the logic of your table.
You count task names and then you add them as a measure??!
I dont think it makes sense.
Best to send a sample of how you want the final table to look like
I have done it on excel.
This is how it looks
Hi @tulsi
You may try to add a rank measure as below. Then drag it to visual level filter and set the measure is less than or equal to 2. If it is not your case, please share some data sample.
Rank = RANKX ( ALL ( Table[task name] ), CALCULATE ( SUM ( Table[Qty] ) ) )
Regards,
Cherie
It worked! Thank you!!!
So I need a bar chart with top 2 task names ( by qty) for respective months.
It should look something like this just top 2 task names should be displayed.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |