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.
Hi everyone,
I was wondering if there is a way to create a calculated column for a 'Commercial Month', that being, I need to work out sales figures from 14th-13th of each 'Commercial Month'.
For example, lets say the first commercial month begins 14/02/2018-13/03/2018, which is February. The commercial month of March would be 14/03/2018-13/04/2018 etc etc. Is there a way (ideally without having to write lots of DAX code as i'm still very new to PowerBI and DAX) which this can be calculated?
Thanks in advance
Solved! Go to Solution.
Hi @Anonymous,
You could create a calucated column in your calendar table with the formula below.
Column = VAR t = IF ( DAY ( [Date] ) >= 14, MONTH ( [Date] ), IF ( DAY ( [Date] ) <= 13, IF ( MONTH ( [Date] ) <> 1, MONTH ( [Date] ) - 1, 12 ) ) ) RETURN FORMAT ( DATEVALUE ( t & "-" & "2018" ), "mmmm" )
Here is the output.
Best Regards,
Cherry
Do you have a Calendar table?
Yes I do have a calendar table.
Hi @Anonymous,
You could create a calucated column in your calendar table with the formula below.
Column = VAR t = IF ( DAY ( [Date] ) >= 14, MONTH ( [Date] ), IF ( DAY ( [Date] ) <= 13, IF ( MONTH ( [Date] ) <> 1, MONTH ( [Date] ) - 1, 12 ) ) ) RETURN FORMAT ( DATEVALUE ( t & "-" & "2018" ), "mmmm" )
Here is the output.
Best Regards,
Cherry
That worked! Thank you very much for your help Cherry!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |