locked
Format the DAX Formula RRS feed

  • Question

  • Hi All,

    I have created a new measure in the power pivot as below

    ((sum(SSI[Billed])-sum(SSF[Billed]))/(sum(SSF[Billed]))), Now i want that to be

    Formatted as [Blue]0.0%;[Red]-0.0%

    Whether i can include the Format formula in the same Query or whether i need create a new measure?

    Please help.

    Mahi

    Thursday, June 21, 2012 1:08 PM

Answers

  • Hi Mahesh, 

    You will not be able to format the color of your measure in PowerPivot through a DAX expression.

     However as a workaround, you can use the conditional formatting feature of Excel to achieve the same (although, you might need to repeat the steps wherever the measure is used).

    If you are displaying the results in a SSRS report, you can use the link that Raunak showed 


    Cheers,
    Jason
    P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)

    Some Random Thoughts

    Follow me on Twitter

    • Marked as answer by Elvis Long Tuesday, July 3, 2012 11:26 AM
    Thursday, June 21, 2012 5:52 PM
    Answerer

All replies

  • Hi Mahesh,

    Text formattings are best handled at reporting layer. Like you can apply conditional logic expressions in SSRS.


    Please vote as helpful or mark as answer, if it helps
    Cheers, Raunak | t: @raunakjhawar | My Blog

    Thursday, June 21, 2012 1:42 PM
  • Hi Raunak,

    Thanks for the reply. But i am not getting your point. I need a simple formula in Expersion itself. Like when i give this (((sum(SSI[Billed])-sum(SSF[Billed]))/(sum(SSF[Billed]))) ) formula, is it possible that i give like =FORMAT(((sum(SSI[Billed])-sum(SSF[Billed]))/(sum(SSF[Billed]))),[Blue]0.0%;[Red]-0.0%

    Please let me know.

    Many Thanks,

    Mahi

    Thursday, June 21, 2012 1:51 PM
  • Mahi,

    Check this link: http://weblogs.sqlteam.com/joew/archive/2008/08/20/60693.aspx


    Please vote as helpful or mark as answer, if it helps
    Cheers, Raunak | t: @raunakjhawar | My Blog

    Thursday, June 21, 2012 5:30 PM
  • Hi Mahesh, 

    You will not be able to format the color of your measure in PowerPivot through a DAX expression.

     However as a workaround, you can use the conditional formatting feature of Excel to achieve the same (although, you might need to repeat the steps wherever the measure is used).

    If you are displaying the results in a SSRS report, you can use the link that Raunak showed 


    Cheers,
    Jason
    P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)

    Some Random Thoughts

    Follow me on Twitter

    • Marked as answer by Elvis Long Tuesday, July 3, 2012 11:26 AM
    Thursday, June 21, 2012 5:52 PM
    Answerer