Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I have column 'Week-Year' with records such as 15-2018, 16-2018, .............29-2018. I want to create an expression and might use it as a dynamic text "past _____ weeks". Lets say the starting week is 15-2018 and current week running is 29-2018, the result set should show 14. i.e., "past 14 weeks".
No 'Date' realted tables are available in my table.
What DAX should I use to get this result set? Do I need to split the column Week and Year and then create DAX?
Thanks!
Solved! Go to Solution.
Hi @BBIUser,
You could create the calculated column with the formula 1 and create measure with formula 2.
1. V_Weeks = LEFT('Table1'[Week-Year],2)
2. Measure = "Past"& MAX('Table1'[V_Weeks])-MIN('Table1'[V_Weeks])&"weeks"
Here is the output.
If you still need help, please share some data sample and your desired output so that we could help further on it.
Best Regards,
Cherry
You can use formula like
V_Weeks=Left(Week-Year)
V_Diff=max(V_Week)-main(V_Week)
Thanks for the reply @Anonymous. Having trouble with these expressions.
Is V_Weeks a calculated Column and V_Diff a calculated Measure?
Hi @BBIUser,
You could create the calculated column with the formula 1 and create measure with formula 2.
1. V_Weeks = LEFT('Table1'[Week-Year],2)
2. Measure = "Past"& MAX('Table1'[V_Weeks])-MIN('Table1'[V_Weeks])&"weeks"
Here is the output.
If you still need help, please share some data sample and your desired output so that we could help further on it.
Best Regards,
Cherry
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 51 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 38 | |
| 29 | |
| 27 |