Forum Discussion
filipe197
8 years agoFrequent Visitor
How to use button to modify measure
Hello,
I want to set a measure (i will call it Rate) but i wanna somehow link it to a button that could consider or not one of the parcels (or set it to zero). In the example below the measure is the formula for "Rate" ant the button would consider or not the parcel of Manual movements according the user will. Hou can i do this??
Rate = (Costs + Manual movements)/Income
Customer Costs Manual Movements Income
1 10 2 50
2 20 5 70
3. 30 10 100
Sum. 60 17 220
Button YES - considering manual movements
NO - Not considering manual movements
Result:
Yes - =(60+17)/220
No - =60/220
I want to set a measure (i will call it Rate) but i wanna somehow link it to a button that could consider or not one of the parcels (or set it to zero). In the example below the measure is the formula for "Rate" ant the button would consider or not the parcel of Manual movements according the user will. Hou can i do this??
Rate = (Costs + Manual movements)/Income
Customer Costs Manual Movements Income
1 10 2 50
2 20 5 70
3. 30 10 100
Sum. 60 17 220
Button YES - considering manual movements
NO - Not considering manual movements
Result:
Yes - =(60+17)/220
No - =60/220
Hi filipe197,
There is a slicer visual in Power BI rather than a button. You can try it in this file.
1. An independent table Buttons.
Yes
No
2. A measure.
Result = IF ( HASONEVALUE ( Buttons[Button] ), IF ( VALUES ( Buttons[Button] ) = "Yes", DIVIDE ( SUMX ( 'Table1', 'Table1'[Costs] + Table1[Manual Movements] ), SUM ( Table1[Income] ), 0 ), DIVIDE ( SUM ( Table1[Costs] ), SUM ( Table1[Income] ), 0 ) ), BLANK () )Best Regards,
Dale
2 Replies
- v-jiascu-msftMicrosoft Employee
Hi filipe197,
There is a slicer visual in Power BI rather than a button. You can try it in this file.
1. An independent table Buttons.
Yes
No
2. A measure.
Result = IF ( HASONEVALUE ( Buttons[Button] ), IF ( VALUES ( Buttons[Button] ) = "Yes", DIVIDE ( SUMX ( 'Table1', 'Table1'[Costs] + Table1[Manual Movements] ), SUM ( Table1[Income] ), 0 ), DIVIDE ( SUM ( Table1[Costs] ), SUM ( Table1[Income] ), 0 ) ), BLANK () )Best Regards,
Dale
- filipe197Frequent Visitorv-jiascu-msftyou rule !! It has worked!!