Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Filter a virtual table

Hello everyone,

 

How can I filter a virtual table dynamically?

 

I need the "u_country" column to change according to the user's choice.

 

Summarize_Table = CALCULATETABLE(
                                                           SUMMARIZE(
                                                                       'SQL - Problem';
                                                                       'SQL - Problem'[_Index];
                                                                       "Total_Lines"; COUNT('SQL - Problem'[Number]);
                                                                       "Total_Group"; SUM('SQL - Problem'[_Duration-Days(All)]);
                                                                       "Average"; AVERAGE('SQL - Problem'[_Duration-Days(All)]);
                                                                      "Stdev"; STDEV.P('SQL - Problem'[_Duration-Days(All)]);
                                                                      "Date_Period"; MIN('SQL - Problem'[Created].[Date]) & " - " & MAX('SQL - Problem'[Created].[Date])
                                                           );
                                   'SQL - Problem'[u_country] = "Chile")

 

Is it possible to do that?

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Do you mean:

     

    Summarize_Table = 
                                                               SUMMARIZE(
                                                                          FILTER('SQL - Problem'[u_country] = "Chile");
                                                                          
                                                                           'SQL - Problem'[_Index];
                                                                           "Total_Lines"; COUNT('SQL - Problem'[Number]);
                                                                           "Total_Group"; SUM('SQL - Problem'[_Duration-Days(All)]);
                                                                           "Average"; AVERAGE('SQL - Problem'[_Duration-Days(All)]);
                                                                          "Stdev"; STDEV.P('SQL - Problem'[_Duration-Days(All)]);
                                                                          "Date_Period"; MIN('SQL - Problem'[Created].[Date]) & " - " & MAX('SQL - Problem'[Created].[Date])
                                                               );
                                      
    • Anonymous's avatar
      Anonymous
      Not applicable

      Not exactly, the calculations would be performed for the country that the user chooses.

      The country is not fixed.