Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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:-

 

Help1.PNG

 

 

 

But if I use Format Function in Gross Margin:- 

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

 

Help2.PNG

 

 

 

 

 

 

 

 

 

 

 

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 6
V-lianl-msft
Community Support
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
Not applicable

Thanks for reply.

 

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

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.

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

Hello,

 

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

 

Thanks,
Yoav

amitchandak
Super User
Super User

@Anonymous , seem like you trying to create a measure slicer. That that is the issue. You have returned a formatted number.

Dynamic formatting is now allowed yet

https://docs.microsoft.com/en-us/power-bi/desktop-custom-format-strings

https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.