Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago
Solved

Create conditional column in calculated table

Hello good people!

Thanking you for your support in advancing my knowledge in Power BI, I comment:

I have generated a generic table "Date" as follows:

Date =
CALENDAR( DATE( 2021, 07 , 01 ) , DATE( 2022,12,31 ) )
As you can see, it is a simple formula that generates the dates from 01-07-2021 to 31-12-2022.
What I want is to add a column called "FY" where, from 01-07-2021 to 30-06-2022 it is FY21 and from 01-07-2022 to 31-12-2022 it is FY22.
Greetings and thanks and in advance!
  • Hi,

    Write this calculated column formula in the Date Table

    Financial Year = if(month(date[Date])>=7,"FY"&Year(date[Date]),"FY"&Year(date[Date])-1)

    Hope this helps.

4 Replies

  • It is possible to create a Calendar table with finacial year using DAX

    but it is best pratice to use Power Query.

    it will take you a few hours to learn but once built you can use it always and 

    the Calendar table  is the most important Power Bi table !

     

    Please do all these free courses.
    Your answer is in the last course but please do the other courses first.

     Calendar Table training

    Fiscal year calendar training 

     

    Thanks for reaching out for help.

    I put in a lot of effort to help you, now please quickly help me by giving kudos.

    Remeber we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

    If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

    One question per ticket please. If you need to extend your request then please raise a new ticket.

    You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

     

  • Hi,

    Write this calculated column formula in the Date Table

    Financial Year = if(month(date[Date])>=7,"FY"&Year(date[Date]),"FY"&Year(date[Date])-1)

    Hope this helps.

  • Good

    I'm working in a project company and I have a problem with a report I want to generate based on duplicate operation codes. The source from which I obtain the data is an excel exported from a report that generates records for each of the reasons that cause an offer to be rejected.

    The problem is that I want to analyze the offers according to their reason for rejection but there are times when a offer is rejected for more than one reason. This causes two records with the same information to be generated for the same offer for all fields except for the reason for rejection:

    CodeGround for rejectionMatter
    ABCDPrice214.209
    ABCDTechnical offer214.209

    Because of this, when I want to generate a table or graph analyzing the lost offers due to rejection and price, the sums of amounts are incorrect since it counts x2 or x3 amounts of rejected offers... To avoid this, I understand that I would need to create a column that collects only once the amount of several records with the same code, leaving the rest of the records with the same code blank. Something like the "Actual amount" column:

    CodeGround for rejectionMatterActual amount
    ABCDPrice214.209214.209
    ABCDTechnical offer214.209

    Does anyone know what function you could use to generate this column?

    Thank you very much in advance!

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Super User

      Hi,

      Share data in a format that can be pasted in an MS Excel file and show the expected result very clearly.