Can You Create a Measure from Power BI Visual Results?
Question details
The user wants to know if it is possible to create a Power BI measure directly from the output displayed in a matrix visual to calculate a distinct employee count percentage.

- Product
- Power BI
- Device & OS
- not provided
- Scenario
- Calculating a percentage based on distinct employee counts utilizing the results shown in a Power BI visual.
- Observed behavior
- The user is attempting to derive a new calculation directly from an aggregated visual result rather than building a DAX measure from the underlying data model.
Ensure you have access to the underlying dataset in Power BI Desktop and understand your basic table relationships before attempting to write DAX formulas.
Create a DAX Measure from the Data Model
Since Power BI does not allow you to create measures directly from visual outputs like matrices, you must write a DAX formula using functions like DISTINCTCOUNT and CALCULATE.
Power BI measures are evaluated based on filter context and the underlying data model, not on the aggregated output displayed on the screen. To compare values, such as the percentage of distinct employee counts, you must explicitly define the calculation using DAX against the model fields.
Launch Power BI Desktop and navigate to the Data view or Report view where your fields are accessible.
Right-click the specific table where you want to store the measure in the Fields pane and select 'New measure'.
Write your DAX formula starting with the DISTINCTCOUNT function to calculate the unique number of employees in the current context.
Use the CALCULATE function combined with ALL or ALLEXCEPT to determine the required total population for your percentage division.
Divide the distinct count by the calculated total using the DIVIDE function, hit Enter, and format the new measure as a percentage to use in your matrix visual.

Analyze Data Seamlessly with WPS Office
While Power BI handles complex DAX measures, WPS Office provides a lightweight, highly compatible alternative for everyday data analysis, pivot tables, and spreadsheet reporting without the steep learning curve.

Frequently Asked Questions
Why can't I reference a matrix visual directly in a DAX measure?
Visuals in Power BI are dynamic representations of data queries. DAX measures must strictly reference the underlying tables, columns, and data model relationships to ensure calculations are evaluated correctly based on the dynamically applied filter context.
How do I calculate a percentage of a total in Power BI?
You can calculate a percentage by creating a measure that divides the current context value by the total value. Use the DIVIDE function along with CALCULATE and ALL (or ALLEXCEPT) to remove active filters and retrieve the grand total for the denominator.
What is the difference between DISTINCTCOUNT and COUNT in DAX?
The DISTINCTCOUNT function returns the number of unique, non-repeating values in a column, whereas the COUNT function simply tallies all non-blank values, including duplicates. For metrics like unique employee headcount, DISTINCTCOUNT is necessary.




