The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
Thank you, in advance for all the help & suggestions.
Solved! Go to Solution.
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.
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.
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.
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.
Hello Everyone,
Please try using the following link. Hopefully this works.
Thank you,
Link to the file
Power BI
https://drive.google.com/file/d/16M4-cWDPnDcS6iW3unfEI6-AM2tx5Tcl/view?usp=drive_link
Excel
Hey, looks like the links for the attached documents are not working properly