Forum Discussion

ashshiv_123's avatar
ashshiv_123
Helper I
3 years ago

please provide solution for below error

 

6 Replies

    • ashshiv_123's avatar
      ashshiv_123
      Helper I

      Thanks for your feedback.

      Please give solution for second quarter formula error also.

      i have to use both simultaneously. so will be able to try this solution only after getting solution for both.

      Thanks 

      Ashshin_123

      • nandukrishnavs's avatar
        nandukrishnavs
        Community Champion

        ashshiv_123 

         

        Quarter =
        VAR _monthno =
            MONTH ( 'Date'[Date] )
        VAR _result =
            SWITCH (
                TRUE (),
                _monthno <= 3 = "Q3",
                    _monthno <= 6 = "Q4",
                _monthno <= 9 = "Q1", "Q2"
            )
        RETURN
            _result
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ashshiv_123 ,

    Your mistake was caused by an error in your formulas:

    The first screenshot:

    1. Month[ ] function is wrong, Month() is correct 

    MONTH(<datetime>)  

    2. Don't nest formulas too much, try use VAR variables

    3. If there is more than one condition, try using the switch function

     

    The second screenshot

    The format function must have at least two parameters

    FORMAT(<value>, <format_string>[, <locale_name>])

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • ashshiv_123's avatar
      ashshiv_123
      Helper I

      Ok. Thanks for providing solution to my issue.

       

      Will try it and will let you know.

       

      Regarding using VAR variables, thanks for guiding me. but i am still in begginers phase of self learning power BI. i have yet to reach that phase. will definitly apply your suggestion once i reach that stage. i am still doing R & D. many more to learn yet. 

       

      Once again thanks for your feedback.

       

      Thanks & Regards,

       

      ashshiv_123