Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
Consider the following simple example of two possible line graphs based on counts:
What I want, however, is a graph with percentages (like the second one), but where the percentages are not in terms the overall total, but in terms of the totals for the x-axis values (i.e. subtotals by date). In other words, for 01 May 2019, I want to have values 50% (3 / 6) for Group A and 50% (3 / 6) for Group B; for 02 May 2019, I want to have values 75% (6 / 😎 for Group A and 25% (2 / 😎 for Group B; for 03 May 2019, I want 33% (2/6) and 66% (4/6) respectively.
How do I go about to do that? (I suppose I need to create a measure in DAX, but I am not sure how to construct it).
Thanks.
You can create two measures using DAX below:
Percentage Of Group A = CALCULATE(SUM('Table'[Count of Group]), FILTER(ALLEXCEPT('Table', 'Table'[Date]), 'Table'[Group] = "A")) / CALCULATE(SUM('Table'[Count of Group]), ALLEXCEPT('Table', 'Table'[Date])) Percentage Of Group B = CALCULATE(SUM('Table'[Count of Group]), FILTER(ALLEXCEPT('Table', 'Table'[Date]), 'Table'[Group] = "B")) / CALCULATE(SUM('Table'[Count of Group]), ALLEXCEPT('Table', 'Table'[Date]))
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
91 | |
51 | |
49 | |
45 |