Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Harish85
Helper I
Helper I

Created Fiscal_period using below sap formula

Below is the formula written in webi Report sap ,same variable should be created in powerbi

v_fiscal_period =If([v_Fiscal_Month]="07";"4";
If([v_Fiscal_Month]="06";"3";
If([v_Fiscal_Month]="05";"2";
If([v_Fiscal_Month]="04";"1";
If([v_Fiscal_Month]="03";"12";
If([v_Fiscal_Month]="02";"11";
If([v_Fiscal_Month]="01";"10";
If([v_Fiscal_Month]="12";"9";
If([v_Fiscal_Month]="11";"8";
If([v_Fiscal_Month]="10";"7";
If([v_Fiscal_Month]="09";"6";
If([v_Fiscal_Month]="08";"5";[v_Fiscal_Month]))))))))))))

2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@Harish85 , Try using switch DAX

v_fiscal_period =
SWITCH(
TRUE(),
[v_Fiscal_Month] = "07", "4",
[v_Fiscal_Month] = "06", "3",
[v_Fiscal_Month] = "05", "2",
[v_Fiscal_Month] = "04", "1",
[v_Fiscal_Month] = "03", "12",
[v_Fiscal_Month] = "02", "11",
[v_Fiscal_Month] = "01", "10",
[v_Fiscal_Month] = "12", "9",
[v_Fiscal_Month] = "11", "8",
[v_Fiscal_Month] = "10", "7",
[v_Fiscal_Month] = "09", "6",
[v_Fiscal_Month] = "08", "5",
[v_Fiscal_Month]
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

Kedar_Pande
Resident Rockstar
Resident Rockstar

@Harish85 

New Column DAX

v_fiscal_period = 
SWITCH(
TRUE(),
[v_Fiscal_Month] = "07", "4",
[v_Fiscal_Month] = "06", "3",
[v_Fiscal_Month] = "05", "2",
[v_Fiscal_Month] = "04", "1",
[v_Fiscal_Month] = "03", "12",
[v_Fiscal_Month] = "02", "11",
[v_Fiscal_Month] = "01", "10",
[v_Fiscal_Month] = "12", "9",
[v_Fiscal_Month] = "11", "8",
[v_Fiscal_Month] = "10", "7",
[v_Fiscal_Month] = "09", "6",
[v_Fiscal_Month] = "08", "5",
[v_Fiscal_Month]
)

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

View solution in original post

3 REPLIES 3
Kedar_Pande
Resident Rockstar
Resident Rockstar

@Harish85 

New Column DAX

v_fiscal_period = 
SWITCH(
TRUE(),
[v_Fiscal_Month] = "07", "4",
[v_Fiscal_Month] = "06", "3",
[v_Fiscal_Month] = "05", "2",
[v_Fiscal_Month] = "04", "1",
[v_Fiscal_Month] = "03", "12",
[v_Fiscal_Month] = "02", "11",
[v_Fiscal_Month] = "01", "10",
[v_Fiscal_Month] = "12", "9",
[v_Fiscal_Month] = "11", "8",
[v_Fiscal_Month] = "10", "7",
[v_Fiscal_Month] = "09", "6",
[v_Fiscal_Month] = "08", "5",
[v_Fiscal_Month]
)

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Thank you very much this helped a lot for me.

bhanu_gautam
Super User
Super User

@Harish85 , Try using switch DAX

v_fiscal_period =
SWITCH(
TRUE(),
[v_Fiscal_Month] = "07", "4",
[v_Fiscal_Month] = "06", "3",
[v_Fiscal_Month] = "05", "2",
[v_Fiscal_Month] = "04", "1",
[v_Fiscal_Month] = "03", "12",
[v_Fiscal_Month] = "02", "11",
[v_Fiscal_Month] = "01", "10",
[v_Fiscal_Month] = "12", "9",
[v_Fiscal_Month] = "11", "8",
[v_Fiscal_Month] = "10", "7",
[v_Fiscal_Month] = "09", "6",
[v_Fiscal_Month] = "08", "5",
[v_Fiscal_Month]
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.