How can I create a measure and filter on multiple values in Power BI?

Power BI is a powerful data analysis tool that allows users to create measures and filters to effectively analyze and visualize data. To create a measure and filter on multiple values in Power BI, users can follow a simple process. Firstly, they can create a measure by selecting the “New Measure” option in the “Home” tab. Then, they can use the “Measure Tools” tab to define the measure by selecting the desired values and functions. To create a filter on multiple values, users can use the “Filters” option in the “Visualizations” tab and select the desired fields and values. This will help in narrowing down the data to only the selected values. Overall, Power BI offers a user-friendly interface that makes it easy for users to create measures and filters on multiple values, enabling efficient data analysis and visualization.

Power BI: Create Measure and Filter on Multiple Values


You can use the following syntax in DAX to create a measure that filters rows based on multiple values:

Method 1: Create Measure by Filtering with AND Condition

Sum of Points = 
CALCULATE ( SUM ( 'my_data'[Points] ), 'my_data'[Team] IN { "A", "C" } )

This particular example creates a new measure named Sum of Points that calculates the sum of the values in the Points column only for the rows where the Team column is equal to either A or C.

The following example shows how to use this syntax in practice.

Example: Create Measure and Filter on Multiple Values in Power BI

Suppose we have the following table in Power BI named my_data that contains information about various basketball players:

Suppose we would like to calculate the sum of values in the Points column only for the players who have a value in the Team column of A or C.

To do so, click the Table tools tab and then click the New measure icon:

Then type the following formula into the formula bar:

Sum of Points = 
CALCULATE ( SUM ( 'my_data'[Points] ), 'my_data'[Team] IN { "A", "C" } )

Power BI filter multiple values

We can view this measure by switching to the Report View and inserting a card visualization that displays the value of the measure:

We can see that the sum of points for the players who are on either team A or C is 259.

Additional Resources

The following tutorials explain how to perform other common tasks in Power BI:

x