Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi , I have a column : yearmonthweek, for example 20220414 (2022-04 and week 14).
I want to split this column into 3 and create a measure that returns the last week of each month.
For example 20220417 => "last week of April" etc...
Thank you
Solved! Go to Solution.
@Anonymous ok, so you can do:
Hi @Anonymous ,
Please refer to my pbix file to see if it helps you.
Create a measure.
Measure =
VAR _maxweek =
CALCULATE (
MAX ( 'Table'[week] ),
FILTER (
ALL ( 'Table' ),
'Table'[Year] = SELECTEDVALUE ( 'Table'[Year] )
&& 'Table'[Month] = SELECTEDVALUE ( 'Table'[Month] )
)
)
RETURN
IF ( MAX ( 'Table'[week] ) = _maxweek, 1, BLANK () )
If I have misunderstood your meaning, please provide your pbix file without privacy information and your desired output.
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.
@Anonymous thank you for your answer 😉
@Anonymous Hi!
Can you paste some sample data and the expected result in explicit way?
Thx,
BF.
@BeaBF I have 3 columns: Year, Month, Week
I want to return the last week of each months.
For example : Year = 2022 , Month = 04 and Week of april = 13,14,15,16,17
I want to return 04-17
@Anonymous You have data in this way?
BF
@Anonymous ok, so you can do:
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |