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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Ritesh_Air
Post Patron
Post Patron

Adding two values

Hi,

 

Is there any way to add two scalar values as standalone?

 

For e.g.:  

1. YTD Sales for Person 1 is 1.5 million as Sales Director

2. YTD Sales for the same person is 2.5 million as Sales Commisioner.

 

If I try to add them together then I get 3 million due to some underlying transaction data being same for Person 1.

 

How do I get 1.5 + 2.5 = 4 million (where it just straight up adds those number for that person, without not taking any other things into consideration)

 

Thanks,

Ritesh

 

 

 

image.png 

 

 

 

 
1 ACCEPTED SOLUTION
AllisonKennedy
Community Champion
Community Champion

@Ritesh_Air  DAX will always take the context into consideration, but are you wanting this as a card visual like the screenshot shows?

 

In order to store calculation as a Scalar value, you need to use variables. try:

 

MEASURE YTD Sales All= 

VAR SalesDirectorYTD = CALCULATE([YTD Sales], Role="Sales Director")

VAR SalesCommisionerYTD = CALCULATE([YTD Sales], Role="Sales Commisioner")

RETURN

SalesDirectorYTD + SalesCommisionerYTD


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

2 REPLIES 2
AllisonKennedy
Community Champion
Community Champion

@Ritesh_Air  DAX will always take the context into consideration, but are you wanting this as a card visual like the screenshot shows?

 

In order to store calculation as a Scalar value, you need to use variables. try:

 

MEASURE YTD Sales All= 

VAR SalesDirectorYTD = CALCULATE([YTD Sales], Role="Sales Director")

VAR SalesCommisionerYTD = CALCULATE([YTD Sales], Role="Sales Commisioner")

RETURN

SalesDirectorYTD + SalesCommisionerYTD


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy  Thank you so much Allison. This is exactly what I was looking for!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.