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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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


@ 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!:
The Definitive Guide to Power Query (M)

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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