MEASURE_PERCENT_OF_TOTAL = DIVIDE(,0)Ĭlick on the newly created MEASURE_PERCENT_OF_TOTAL in the list of Fields. By default, the percentage is 100% since all entries are initially selected. The third and final measure calculates the percentage of the selected entries against the whole. MEASURE_SUM_FILTERED_ACTUAL_SPEND_USING_SUM = CALCULATE(SUM('DATA'),FILTER('DATA','DATA' = "ACTUAL")) In this measure, the ALL function is not used since we only want to include entries where the helper column is tagged as “ACTUAL” and we want the calculated to be influenced by user selections and filters in the Donut chart visualization, e.g., if the user selects a category in the visualization, then the center calculation should adjust. The second measure calculates the sum of the “Total” column in the DATA table. MEASURE_TOTAL_ACTUAL_SPEND_USING_CALCULATE = CALCULATE(SUM('DATA'),FILTER(ALL('DATA'),'DATA' = "TOTAL")) Since the underlying table may be influenced by other filters, we use the ALL function in the FILTER for the CALCULATE function in order to ignore any other applied filters and return all rows in the table. Since the sample data already includes a total row, this is trivial since we can simply look for the entry where “Category” is equal to “Total”. The first measure retrieves the total of all the actual spend entries. Now that we have our data structured and tagged, we need to create a few DAX measures to populate the center of the Donut chart. Power BI Desktop – Adjusted Sample Data Step 3 – Create DAX Measures
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |