Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Get different datatypes in single numeric column

Hi Team ,

 

I am struggling with the below requirement . I have a column names called Process and Values . In values column I need both Decimal /Whole number and Percentage as shown below .Below is the excel source file , when I get the same into Power Bi desktop, The values are converting to decimals and not able to change the data types as in below image. So, Please help on this as it is the urgent requirement that I stucked in it .Need both Whole Number and Percentage in a single column called Values with respect to Process .

 

9 Replies

  • Anonymous it is not possible to have the same data type in a single column except if you use calculation groups and add the logic there for format string otherwise it is not possible.

     

    Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

    • Anonymous's avatar
      Anonymous
      Not applicable

      But if we see the below it happened .May I know how is it possible . Becauese here Unit Reviewed and Utilization% belons to process column and values column consists of marked values 207 and 87 % . 

       

      • littlemojopuppy's avatar
        littlemojopuppy
        Community Champion

        What parry2k @and I said...those are most likely measures with the formatting applied to the measure, not the fields themselves.

  • Anonymous probably measure were created then format was applied to the measure, it is not data type change but it is a formatting

     

    Amount = CALCULATE ( SUM ( Table[Amount] ), Table[Type] = "Sales" )
    
    Rate % = CALCULATE ( SUM ( Table[Amounnt] ), Table[Type] = "Rate" )

     

    in the above two measure, the sum is used from the same amount column and filtered on some condition and now for above measure I can give different display format, one can be currency and other can be %

     

    I hope it helps.

    • Anonymous's avatar
      Anonymous
      Not applicable

      HI Parry ,

      It seems it works out but I am getting the values for all process fields but we need it only for Efficiency % in example and also the sign % should be beside it.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        All the values has group by for all the process records but that value should be for Efficeincy % in the example

  • littlemojopuppy's avatar
    littlemojopuppy
    Community Champion

    If I'm understanding you correctly, you want multiple data types for a single field?  That isn't possible...fields always have a defined data type.  If your need is based on output requirements, you can create measures for calculations and format those measures as decimal, percentage or whole number as necessary.

    • Anonymous's avatar
      Anonymous
      Not applicable

      The output I Need in table visual like below

      But if we see the below it happened .May I know how is it possible . Becauese here Unit Reviewed and Utilization% belons to process column and values column consists of marked values 207 and 87 % . 

       

  • Anonymous for your measure, wrap your filter condition in KEEPFILTERS

     

    Measure % = CALCULATE ( SUM ( Table[Amount] ), KEEPFILTERS ( Table[Type] = "ABC" ) )