Forum Discussion

nrungta's avatar
nrungta
Frequent Visitor
6 years ago
Solved

Apply two rows filter

My data has a column Country. I have data points of 10 countires in the Country Column. Now I want to use average Sales of only two countries, USA and India.  1. How can I use this in a Measure? 2....
  • Anonymous's avatar
    Anonymous
    6 years ago

    Measure

    AverageSales = Calculate([Your Average Calculation], Filter([Your Table], Country = "USA" || Country = "India")

     

    New Table

    Option1:

    Look at this post by v-jiascu-msft to create a summaryized table

    https://community.powerbi.com/t5/Desktop/Summarize-Table-and-Filter-by-Date/m-p/465088/highlight/true#M215907

     

    Option 2: 

    Or from Power Query you could always create a reference to your original table and filter out data not related to USA or India. This would leave you with just the data your loking for. 

     

     

  • v-eachen-msft's avatar
    6 years ago

    Hi nrungta ,

     

    You could create a new table with CALCULATETABLE() function.

    Table 2 =
    CALCULATETABLE (
        test,
        FILTER ( test, test[country] = "India" || test[country] = "US" )
    )