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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
wokka
Helper IV
Helper IV

Create a table with 2 percentage outputs from same measure

I have a custom measure in powerbi that does 2 calculations and produces 2 values. This is the code

 

_Custom_Measure =

 

VAR   Perc = ( do some calculation )      - this is the percentage

VAR   Remains = 100-VAR2                           - this is the 100 - %  figure

 

RETURN

       Perc & Remains

 

Except I get this weird output where I dont see the [Remains] displayed.

 

Can someone please explain how I can display 2 values [Perc] and [Remains]  side by side like below :

 

[Sales]   [Perc] [Remains]

Q1         70      30

Q2         80      20

etc 

 

 

Maybe I need 2 separate measures?

 

Thanks in advance

 

1 ACCEPTED SOLUTION
BhavinVyas3003
Super User
Super User

You need to define two separate DAX measures, like this:

  1. Perc Measure

Perc = -- your logic here

DIVIDE([SomeValue], [TotalValue]) * 100

 

  1. Remains Measure

Remains =

100 - [Perc]

 

Just add all three fields: [Sales], [Perc], and [Remains] to the Values pane of a Table visual.


Thanks,
Bhavin
Problem solved? Hit “Accept as Solution” and high-five me with a Kudos! Others will thank you later!

View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

@wokka 

VAR stores the result of an expression as a named variable. The measure will only provide the output after return. 

If you want the remains value, you need to create a remain measure.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




BhavinVyas3003
Super User
Super User

You need to define two separate DAX measures, like this:

  1. Perc Measure

Perc = -- your logic here

DIVIDE([SomeValue], [TotalValue]) * 100

 

  1. Remains Measure

Remains =

100 - [Perc]

 

Just add all three fields: [Sales], [Perc], and [Remains] to the Values pane of a Table visual.


Thanks,
Bhavin
Problem solved? Hit “Accept as Solution” and high-five me with a Kudos! Others will thank you later!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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