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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Community Champion
Community Champion

@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
Community Champion
Community Champion

@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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.