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 am working on creating a combined table in Power BI.
I have a month calculation. And my month does not start from the 1, but from the 16th in every mont. This means that my month contains two month names (e.g. from the 16th of september to the 15 of october). I Would like a coloumn were the displayed mothes are combined, so that the month in my example will be September-October. I have all of the information of a calander stored in a Power BI DimDate Table. So i have the month names starting from the 1st, and should therefore be able to combine these. I do not know how to make Power BI recognise that the month name should be a combined name of the two months.
Can anyone help me with this?
Thank you in advance.
Solved! Go to Solution.
You can make a calculated column like the one below
monthAlt = VAR __firstMonth = IF( dimKalender[DayInMonth] < 16; IF( dimKalender[MonthInYear] = 1; 12; dimKalender[MonthInYear] - 1 ); dimKalender[MonthInYear] ) VAR __secondMonth = IF( dimKalender[DayInMonth] < 16; dimKalender[MonthInYear]; IF( dimKalender[MonthInYear] = 12; 1; dimKalender[MonthInYear] + 1 ) ) RETURN FORMAT(DATE(2020; __firstMonth;1); "mmm") & "-" & FORMAT(DATE(2020;__secondMonth;1); "mmm")
if it works then please mark it as the solution
You can make a calculated column like the one below
monthAlt = VAR __firstMonth = IF( dimKalender[DayInMonth] < 16; IF( dimKalender[MonthInYear] = 1; 12; dimKalender[MonthInYear] - 1 ); dimKalender[MonthInYear] ) VAR __secondMonth = IF( dimKalender[DayInMonth] < 16; dimKalender[MonthInYear]; IF( dimKalender[MonthInYear] = 12; 1; dimKalender[MonthInYear] + 1 ) ) RETURN FORMAT(DATE(2020; __firstMonth;1); "mmm") & "-" & FORMAT(DATE(2020;__secondMonth;1); "mmm")
if it works then please mark it as the solution
@Anonymous
aMAZING! thank you so much 😄 worked like a charm
You can use this:
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 |
---|---|
105 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |