1
votes

I have created a few reports using Power BI and Direct Query. All the visuals have used the standard filters in the Power BI tab.

Now I would like to create a report with a large table or matrix containing many rows and columns. Some of these columns are measures which are filtered on other fields. For example, one column will be an amount where a field is equal to "A" and the next column will be an amount where a field is equal to "B". They will both be using the same measure.

How can this be done? If I use the field in the standard filter tab then the entire table will have that filter. Can I create a calculated measure to do the job?

2

2 Answers

1
votes

Yes it can be done using the SELECTEDVALUE DAX function in your measures.

I created a small sample PBIX file demonstrating this technique, and you can download it at:

[demo file]

0
votes

I managed to solve this by using the following DAX:

New measure = CALCULATE(
    [measure_name],
    FILTER(Table_name, Table_name[field_name]="Value A (or Value B)")
)

The SELECTEDVALUE DAX function seems to give the same result as well.