Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
gluizqueiroz
Resolver I
Resolver I

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 5
Greg_Deckler
Community Champion
Community Champion

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



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...


image.png

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.

@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.

Hey @v-yuta-msft.
Yes, I can.

For example, I have the following table:

image.png

 

And I create a calculated table named "Top", like the following:

 image.png

 

For example, I have the following visual:

image.png

 

My problem is: I have just 1 salesperson with sales on "October", if I select the Month October, I have the following result:

 image.png

As you can see, the measure "DistinctCount of column Salesperson..." show me the value 1, and that is correct, I have only 1 salesperson with sales on October, but the "Count of Table "Top" and the Table "Top" continue showing 4, but I selected October, that correct value is 1. 
The Table "Top" was created by this DAX: GENERATESERIES(1; DISTINCTCOUNT(Sales[Salesperson]); 1), like the measure "DistinctCount of column Salesperson..." but the calculated table doesn't suffer the action of filter like measure suffer. 

Is it possible do something about dyamic calculated table, in other words, the table is calculated/created like a measure?

 

I use the column "Top" from table "Table" on a slicer.

Anonymous
Not applicable

Hello,

I have been struggling with the same problem for days. Is there any solution for this? BTW, I believe this might be solved by creating a relation between tables but I do not know how to create such a relation since I need to filter my range slicer by the date selection.

Cheers!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.