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
aguuzdo
Helper I
Helper I

Fill blanks with previous state in accumulative total

Hi, I'm trying to build a funnel with the ammount of persons that where in each group of tenure groups in weeks.
The problem is that if I didn't have a change in one of the groups, I get a blank value while I should get the previous value:

aguuzdo_0-1656595344702.png

 

For example, tenure group 7 in the image should be the previous value 18, not blank.


This is my measure:

Accumulated tenure groups =

VAR UncumulativeTotal = CALCULATE(COUNT('Database'[Tenure (groups)]),'Database'[Tenure (groups in number format)]>=MAX('Database'[Tenure (groups in number format)]))

RETURN
IF(ISBLANK(COUNT('Database'[Tenure (groups)])),BLANK(),UncumulativeTotal)



 

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

Hi @aguuzdo ,

Please modify your formula.

Accumulated tenure groups =

VAR UncumulativeTotal = CALCULATE(COUNT('Database'[Tenure (groups)]),'Database'[Tenure (groups in number format)]>=MAX('Database'[Tenure (groups in number format)]))

RETURN
IF(ISBLANK(COUNT('Database'[Tenure (groups)])),CALCULATE(MAX('Table'[TEenure]),FILTER(ALL('Table'),'Table'[date]=SELECTEDVALUE('Table'[date])-1)),MAX('Table'[TEenure]))

I have create a simpe sample, please refer to it.

vpollymsft_0-1656916737914.png

If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output and your desired output with more details.

 

 Best Regards
Community Support Team _ Polly

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

View solution in original post

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @aguuzdo ,

Please modify your formula.

Accumulated tenure groups =

VAR UncumulativeTotal = CALCULATE(COUNT('Database'[Tenure (groups)]),'Database'[Tenure (groups in number format)]>=MAX('Database'[Tenure (groups in number format)]))

RETURN
IF(ISBLANK(COUNT('Database'[Tenure (groups)])),CALCULATE(MAX('Table'[TEenure]),FILTER(ALL('Table'),'Table'[date]=SELECTEDVALUE('Table'[date])-1)),MAX('Table'[TEenure]))

I have create a simpe sample, please refer to it.

vpollymsft_0-1656916737914.png

If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output and your desired output with more details.

 

 Best Regards
Community Support Team _ Polly

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

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.