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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.