Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
am looking for column formula. If week number continuous to next month I need to get previous month.
Link: Sample file
Regards,
Chandrashekar B
Solved! Go to Solution.
I added the comment:
Column =
VAR _A = CALCULATE (
MIN ( 'Table'[Month] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Week] = EARLIER ( 'Table'[Week] ) )
)
//Get the min date of every week, for examnple, the 16th week is 2024-04-15
RETURN FORMAT(_A,"MMM-YY")
//format the column to "MMM-YY"
The outcome of variable _A:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can you post an example of what you expect to see?
Hello,
Expected result is in sample pbix file(already shared). am looking for column formula(new column) If week number continuous to next month I need to get previous month.
Link: Sample file
Regards,
Chandrashekar B
Your files are set with access permissions, and I'm requesting access.
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please try this:
Create a calculated column:
Column =
FORMAT (
CALCULATE (
MIN ( 'Table'[Month] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Week] = EARLIER ( 'Table'[Week] ) )
),
"MMM-YY"
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you it is working perfectly. Can you please explain how it works in steps please.
Regards,
Chandrashekar B
I added the comment:
Column =
VAR _A = CALCULATE (
MIN ( 'Table'[Month] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Week] = EARLIER ( 'Table'[Week] ) )
)
//Get the min date of every week, for examnple, the 16th week is 2024-04-15
RETURN FORMAT(_A,"MMM-YY")
//format the column to "MMM-YY"
The outcome of variable _A:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
21 | |
11 | |
10 | |
10 | |
8 |