Forum Discussion

gluizqueiroz's avatar
gluizqueiroz
Icon for Resolver I rankResolver I
7 years ago

How to create a dynamic generate series

I have a table that is created by the following DAX:

 

Top = GENERATESERIES(1; DISTINCTCOUNT(Sales[Id_Salesperson]); 1)

So far, the table is created with 248 rows, but when I select a month, I dont have 248 salesperson, just 50 for example in the selected month, then, I need to create a dynamic generate series that returns to me the DISTINCTCOUNT of ID_Salesperson and suffer the action of filters. 
I'm creating a calculated table with generate series because I'm using this on a slicer to filter a table with a measure. 

Is it possible?

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Not with a calculated table, you would have to use a pure measure to make it dynamic.

    • gluizqueiroz's avatar
      gluizqueiroz
      Icon for Resolver I rankResolver I




      I use the previous slicer to show X salesperson on a table. If the user select 248 on slicer, the table will show 248 salesperson, if he choose 10 on slicer, the table will show 10 salesperson.
      This values on slicer is a column from "Table" named Top that I mentioned before and this valeus is genereted by GENERATESERIES,

      You tell me that I can't do this with calculated table, just pure measure, but how can I put a measure on a slicer to filter the table? 
      I create a calculated table because I just can filter with "real" values, in other words, I just can filter (put on slicer) values that came from table, not measure.

      I think it is impossible achieve my goal, am I right?

      Thanks for help Greg.

      • v-yuta-msft's avatar
        v-yuta-msft
        Icon for Community Support rankCommunity Support

        gluizqueiroz,

         





        I use the previous slicer to show X salesperson on a table. If the user select 248 on slicer, the table will show 248 salesperson, if he choose 10 on slicer, the table will show 10 salesperson.
        This values on slicer is a column from "Table" named Top that I mentioned before and this valeus is genereted by GENERATESERIES,

        You tell me that I can't do this with calculated table, just pure measure, but how can I put a measure on a slicer to filter the table? 
        I create a calculated table because I just can filter with "real" values, in other words, I just can filter (put on slicer) values that came from table, not measure.


        Could share some sample data and give expected result?

         

        Community Support Team _ Jimmy Tao

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.