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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mallap849
Helper I
Helper I

How to create a new measure from two calculated tables?

Hello Everyone,

 

I have two different sources of data (Files are attached below).  – Table 1 and Table 2. Table 1 has the actual expense for the month i.e., TRANS VALUE. The expenses happen on different days of the month i.e., TRANS_DATE.

Table 2 has the budget by month and year so I create a new variable Date.

I first aggregate the two tables to Table 1a and Table2a so that I can get the Actual (from Table 1) and Budget (from Table 2) by Org.

 

However, I could not create a VAR and %VAR

Desired Output:

 

mallap849_1-1704843182436.png

 

 Thank you, in advance for all the help & suggestions.

 

Excel File 

Power BI File 

 

1 ACCEPTED SOLUTION
v-weiyan1-msft
Community Support
Community Support

Hi @mallap849 ,

 

Based on the sample and description you provided,
Please try code as below to create two measures.

VAR = SELECTEDVALUE('Table2a'[Budget-FY'23]) - SUMX('Table1a',[EXP])
%VAR = 
var Total_EXP =  SUMX('Table1a',[EXP])
return
IF(Total_EXP, Total_EXP / SELECTEDVALUE('Table2a'[Budget-FY'23]),0)     

Result is as below.

vweiyan1msft_0-1704861878814.png

 

Best Regards,
Yulia Yan

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

View solution in original post

6 REPLIES 6
v-weiyan1-msft
Community Support
Community Support

Hi @mallap849 ,

 

Based on the sample and description you provided,
Please try code as below to create two measures.

VAR = SELECTEDVALUE('Table2a'[Budget-FY'23]) - SUMX('Table1a',[EXP])
%VAR = 
var Total_EXP =  SUMX('Table1a',[EXP])
return
IF(Total_EXP, Total_EXP / SELECTEDVALUE('Table2a'[Budget-FY'23]),0)     

Result is as below.

vweiyan1msft_0-1704861878814.png

 

Best Regards,
Yulia Yan

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

Thank you, @v-weiyan1-msft . This works.

mallap849
Helper I
Helper I

gadielsolis
Resolver III
Resolver III

Hey, looks like the links for the attached documents are not working properly

@gadielsolis  does the above link work? LMK Thank you!

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.

Top Solution Authors