Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Two Measure Inside If function, One is Value and One is Percentage

Hi Pro's,

 

I have measure which contains two measure and display result based on If condition: - 

IF (
MAX ( DimDrawer[MainDrawerName] ) = "Gross Margin",
'Key Measures'[Gross Margin],
CALCULATE ( 'Key Measures'[BalanceSC] )
+ CALCULATE ( SUM ( 'FA Forcast'[Value] ), 'FA Forcast'[Version] = "C.Forecast" )
)
But in above measure I want to display the Gross Margin in Percentage. If I add Format function I am getting result but some balnk also showing in the report.
 
For reference:- 
If I not use Format Function in Gross Margin:- 

'Key Measures'[Gross Margin],"0.00%" the report shows as below:-

 

 

 

 

But if I use Format Function in Gross Margin:- 

Format('Key Measures'[Gross Margin],"0.00%") the report changes to below

 

 

 

 

 

 

 

 

 

 

 

 

Please can anyone help me to use Two measures, one is Value and One is percent inside another measure without affecting the result.

 

 

Thanks in Advance

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi amitchandak ,

     

    Thanks for the reply.

     

    But I am not looking for the slicer. I have row level data and I want between two measures one should display value other should display Percentage.

    Please look into the measure I have shared earlier in the mail, it may give you some idea what I am trying to do.

     

    Thanks

    Amith D

    • yoav_lubo's avatar
      yoav_lubo
      Advocate I

      Hello,

       

      I'm having the exact same issue, please let me know if any solution was found.

       

      Thanks,
      Yoav

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi Anonymous ,

     

    Try to use format function in formula.

    IF (
    MAX ( DimDrawer[MainDrawerName] ) = "Gross Margin",
    FORMAT('Key Measures'[Gross Margin],"##%")
    CALCULATE ( 'Key Measures'[BalanceSC] )
    + CALCULATE ( SUM ( 'FA Forcast'[Value] ), 'FA Forcast'[Version] = "C.Forecast" )
    )

     

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for reply.

       

      I tried but not working. Same issue. Do you have any other option.

      • V-lianl-msft's avatar
        V-lianl-msft
        Community Support

        Hi Anonymous ,

         

        Unfortunately, I can't reproduce your issue. see if you can share the sample pbix file.

        Please mask any sensitive data before uploading

         

        Best Regards,

        Liang
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.