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
Puchkov
Regular Visitor

User input into measure to recalculate

Hello everyone. 

 

I want to create a calculator for users that will show expenses and income on the client.

I made inputs using what-if parameter and a measure. This measure is based on the table with current customers.


It is supposed that these inputs would create a virtual customer into the table and according this new data recalculate the measure for this virtual customer.

 

The table looks like:

photo_2020-12-12_17-46-12.jpg

The measure is:
Opex_на_TRXN =
var Per1=[OPEX(Corp+SME)_avg]*0.5
var Per2=0.5/[sum_cnt]

return sumx('CALC_DATA',
var m=if(CALC_DATA[TURNOVER_AVG]>5000,(Per1*CALC_DATA[CNT_TRXN_AVG]*(Per2+0.5/([sum_cntto]+CALC_DATA[TURNOVER_AVG]))),0)
return m
)

 

 

The result of this measure:

photo_2020-12-12_17-47-32.jpg

My question is how to import these inputs (screenshot below) into a measure to have the right calculation.
In my case it shows only Sum of the measure. I want to see the result for current user inputs like screenshot above.

photo_2020-12-12_17-48-59.jpg

5 REPLIES 5
v-lionel-msft
Community Support
Community Support

Hi @Puchkov ,

 

Please show me the sample .pbix file.

 

 

Best regards,
Lionel Chen

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

 

 

Hi. 

I replaced my measure (Opex_на_TRXN) with a column (Opex_TRXN). The calulation is more correct now, logic stays the same.

Please, check the corrected file instead of the previos one.

 

https://drive.google.com/file/d/1H7sj2J_SoI6qbOCgs1awOTvme0_zjReC/view?usp=sharing

Hi, thank you for your reply.

I made a sample for you. Hopefully, I did it clear now.

The logic of this scheme of work looks like in Excel. When you add a line with parameters to a table, you have a result in the cell for only this line. But the formula in the cell use also aggregated function from the whole array of lines. Hard to explain)

 

https://drive.google.com/file/d/1JADztoXRFdO0d3WJXxCaSPde7IWvFemH/view?usp=sharing

AllisonKennedy
Super User
Super User

@Puchkov I don't fully understand what you want to achieve? Can you please draw out exactly what you want? If you are wanting to add a row to the first table, and have that update based on the whatif parameters, you will need to create a new measure that does everything for you: Power BI Order of Operations 

 

Otherwise if you are just wanting to see how changing the whatif parameters would impact all customers, you may need to create a different slicer for each parameter or add additional parameters that let the user decide which parameters to use in whatif and which to use from the real data. 


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

Well, I tried to draw the scheme of work:

 

Puchkov_0-1607857113315.png

 

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.