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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mmack
New Member

Referencing Current Measure Value in GENERATESERIES?

I thought this would be much easier than it is turning out to be, but I have a Calendar table which I filter for dates. I have a measure setup to return how many calendar days are selected (e.g. 302 calendars on a Card). How can I reference that current measure value of 302 inside a DAX statement to generate a new data series?

 

In this example, I want to generate a series/table with 1 to 302, so I can add columns, etc, afterwards.

 

E.g.

 

newSeries = GENERATESERIES ( 0, CurrentMeasureValue, 1 )

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @mmack ,

 

That will not working. The content of the table will not be changed by the measure unless it is a temporary table generated in the formula.

Table and column created by measure will not change once they are created but measure will.

measure = countrows(GENERATESERIES(1, zfcdates[CalendarDays]))
vjaywmsft_0-1649949111222.png
vjaywmsft_1-1649949126692.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @mmack ,

 

That will not working. The content of the table will not be changed by the measure unless it is a temporary table generated in the formula.

Table and column created by measure will not change once they are created but measure will.

measure = countrows(GENERATESERIES(1, zfcdates[CalendarDays]))
vjaywmsft_0-1649949111222.png
vjaywmsft_1-1649949126692.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Whitewater100
Solution Sage
Solution Sage

Hi:

You can if your measure has a numeric value and you want to get the total of the result. Here is an example:

Test = GENERATESERIES(1,[Last Score],1)
Whitewater100_1-1649440227401.png

 

To answer your question, it will work with a numeric value output from a measure but whether or not you want the result is up to you.
 
I hope this answers your question. Thanks
The problem is that it takes the grand total of all my last scores (they add up to 382) 
If I filter on a person who has a score, it still adds up all last scores and gives a table from 1-382 for example.
So doing this gives you a table considering the total of all values in your measure.

Whitewater100_0-1649439585749.png

 

It is close, but not quite. This is what I experience when I use that method.

 

mmack_0-1649442908852.png

 

Here is my code for zfcdates Date Table:

 

zfcdates = CALENDAR(TODAY()-365, TODAY()+365)

 

 

Here is my code for CalendarDays Measure:

 

CalendarDays = 
VAR FirstDay = CALCULATE(
    MIN('zfcdates'[Date]),
    ALLSELECTED('zfcdates'[Date])
)
VAR LastDay = CALCULATE(
    MAX('zfcdates'[Date]),
    ALLSELECTED('zfcdates'[Date])
)
RETURN
DATEDIFF(FirstDay, LastDay, DAY)

 

 

 

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors