Forum Discussion

filipe197's avatar
filipe197
Frequent Visitor
8 years ago
Solved

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 t...
  • v-jiascu-msft's avatar
    8 years ago

    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 ()
    )

    How_to_use_button_to_modify_measure

     

    Best Regards,

    Dale