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
D_PBI
Post Patron
Post Patron

How to add (sum) a measure value to each row value?

Hi all,
I have create a table that contains a CALCULATE that returns a single value, and a CALCULATETABLE query that summarizes a table creating a DISTINCTCOUNT column.
I am attempting to use ADDCOLUMNS to create an additional column that is the sum of the CALCULATE single value the summarized DISTINCTCOUNT value - but I cannot seem to do this.

Please see the below screenshot of the code (not sure how to provide in a nice structure other than a screenshot). It is the line with the red arrow (highlighted bit) that I am thinking I can add the CALCULATE measure (i.e. _FIG1) with the end result from the DISTINCTCOUNT.
I do know individually the summarized rows are correct and so it the single measure value. I know this as when I don't attempt to add them but just bring into a table visual in separate columns that show the correct figures. I just don't seem to be able to add them together.
Please help??  Thanks.

Code.JPG

3 REPLIES 3
v-rongtiep-msft
Community Support
Community Support

Hi @D_PBI ,

I have created a simple sample. Please refer to my pbix file to see if it helps you.

Create a measure.

Measure 2 = var max_value=CALCULATE(MAX('Table'[value]),FILTER(ALL('Table'),'Table'[contactid]=SELECTEDVALUE('Table'[contactid])))
return 
max_value+[Measure]

vpollymsft_0-1646119340404.png

If you still want calculate the formula in fig_2, please try to var the measure.

If I have misunderstood your meaning, please provide your pbix file without privacy information(or some sample data)  and desired output.

 

Best Regards

Community Support Team _ Polly

 

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

 

D_PBI
Post Patron
Post Patron

If this is the case, are you able to advise how I can achieve my aim?  Thanks.

lgordon
Frequent Visitor

I believe your issue is that filter context in fig1 isn't being applied to the table in fig2

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.