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.
Hello,
I have a table visual which show the topN item-categories based on count of customer complaints.
However, I am also trying to get the percentage of total based on the date range that is selected on a date-slicer in the report. E.g, if the user selects a date range of 1 July 2020 to 31st August 2020 The topN should also show me the percent of total for the two months and not percent of total of the topN.
Any idea how i can achieve this using DAX.
I am able to get the max and min date of the slicer selection using :
Solved! Go to Solution.
[% of Total Cases] =
DIVIDE(
[Total Cases],
CALCULATE(
[Total Cases],
ALL( T[sub_category] )
)
)
@Zephyrvic - You should be able to get the TOPN using TOPN or RANK and then divide that by ALL items. But hard to visualize without sample data.
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
I already have my topN figured out. My table will show me the top20 for any date range i select in the slicer. However, the next thing i want to do is to calculate the percentage of total. But i want the total to be for the entire date range that is selected in the slicer and not the top 20.
For example, the below image shows me the top 20 categories by count of cases between July 1 and Aug 31 2020. now i want to add another column to show the percent of total cases within this same date range in the slicer selection. but when i attempt this, i keep getting the percent of topN total (52,001) instead of the date range total (69,517) for each subcategory.
[% of Total Cases] =
DIVIDE(
[Total Cases],
CALCULATE(
[Total Cases],
ALL( T[sub_category] )
)
)
Hello @Anonymous ,
Many thanks..
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 |
---|---|
37 | |
25 | |
19 | |
14 | |
8 |
User | Count |
---|---|
68 | |
48 | |
45 | |
18 | |
15 |