Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi we have the following date table called "dGLDates".
| GLPeriod | Period | YTD | IsCurrentMonth | Base Act Order | Type | Key | 
| Base Act - 11 | 7/1/2023 | 1 | ACTUAL | ACTUAL7/1/2023 | ||
| Base Act - 10 | 8/1/2023 | 2 | ACTUAL | ACTUAL8/1/2023 | ||
| Base Act - 9 | 9/1/2023 | 3 | ACTUAL | ACTUAL9/1/2023 | ||
| Base Act - 8 | ######## | 4 | ACTUAL | ACTUAL10/1/2023 | ||
| Base Act - 7 | ######## | 5 | ACTUAL | ACTUAL11/1/2023 | ||
| Base Act - 6 | ######## | 6 | ACTUAL | ACTUAL12/1/2023 | ||
| Base Act - 5 | 1/1/2024 | 1 | 7 | ACTUAL | ACTUAL1/1/2024 | |
| Base Act - 4 | 2/1/2024 | 1 | 8 | ACTUAL | ACTUAL2/1/2024 | |
| Base Act - 3 | 3/1/2024 | 1 | 9 | ACTUAL | ACTUAL3/1/2024 | |
| Base Act - 2 | 4/1/2024 | 1 | 10 | ACTUAL | ACTUAL4/1/2024 | |
| Base Act - 1 | 5/1/2024 | 1 | 11 | ACTUAL | ACTUAL5/1/2024 | |
| Base Act | 6/1/2024 | 1 | 1 | 12 | ACTUAL | ACTUAL6/1/2024 | 
| Bud 1 | 1/1/2024 | 1 | BUDGET | BUDGET1/1/2024 | ||
| Bud 2 | 2/1/2024 | 1 | BUDGET | BUDGET2/1/2024 | ||
| Bud 3 | 3/1/2024 | 1 | BUDGET | BUDGET3/1/2024 | ||
| Bud 4 | 4/1/2024 | 1 | BUDGET | BUDGET4/1/2024 | ||
| Bud 5 | 5/1/2024 | 1 | BUDGET | BUDGET5/1/2024 | ||
| Bud 6 | 6/1/2024 | 1 | 1 | BUDGET | BUDGET6/1/2024 | |
| Bud 7 | 7/1/2024 | BUDGET | BUDGET7/1/2024 | |||
| Bud 8 | 8/1/2024 | BUDGET | BUDGET8/1/2024 | |||
| Bud 9 | 9/1/2024 | BUDGET | BUDGET9/1/2024 | |||
| Bud 10 | ######## | BUDGET | BUDGET10/1/2024 | |||
| Bud 11 | ######## | BUDGET | BUDGET11/1/2024 | |||
| Bud 12 | ######## | BUDGET | BUDGET12/1/2024 | 
The user has a slicer where they can select a period on the "Period" column.
I am trying to build a series of measures that would compute a dynamic "last month" so for example:
If 6/1/2024 is selected then the measure would read 5/1/2024.
This is an example measure of what I have so far but its not working/doesnt return the expected result:
Solved! Go to Solution.
Solution I came up with that works:
Solution I came up with that works:
 
					
				
		
Hi @NickDSL ,
Regarding your question, when the user selects '6/1/2024', there are multiple values. It is recommended that you modify your expression.
Like this
Measure = 
VAR _Order = MAX('dGLDates'[Base Act Order]) -1
VAR _result = CALCULATE(MAX('dGLDates'[Period]),ALL(dGLDates[Period]),'dGLDates'[Base Act Order] = _Order)
RETURN IF(_Order = 0,BLANK(),_result)Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | 
| User | Count | 
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 10 | |
| 9 |