Forum Discussion

biconsba's avatar
biconsba
Frequent Visitor
8 years ago
Solved

Multiple parameters for one meassure

Hi All,

 

Is it possible  in power bi to use multiple parameters  for one meassure or using sumx for example?

  • Hey,

     

    I'm not sure what I'm missing, here is a link to pbix file on onedrive.

     

    This file contains more or less the DAX statement from your latest post, and as far as I understand it works as expected.

     

    By the way, you can't upload files, just embed images, if you want to share a pbix, a csv, or an excel file, you have to to provide a link to that file. Sharing sample data this way is most welcome, because is much more simple to use the provided data.

     

    Regards

    Tom

7 Replies

  • Hey,

     

    I'm not sure if I totally understand your question, but the short answer is: Yes

     

    The following picture shows, that two What-If parameters are defined and both are used in the measure. Please be aware that the measures [P1 Value] and [P2 Value] are automatically created during the process of creating the What-If parameter:

     

     

    Hope this is what you are looking for.

     

    Regards

    Tom

  • biconsba's avatar
    biconsba
    Frequent Visitor

     

    It will work if you have two parameters and measure.  I would like to calculate measure using two fields.  

    If I use two columns quantity and price to calculate revenue it dosn't work. 

    Test = (SUMX('Fact Sales', 'Fact Sales'[Unit Price]* (1+(SELECTEDVALUE('Forecast Price'[Price], 0))/100)) *
    (SUMX('Fact Sales', 'Fact Sales'[Quantity]* (1+(SELECTEDVALUE('Forecast Quantity'[Quantity], 0))/100))

     

    Could you please tell me what is wrong or suggest another solution?

     

    Thanks.

    • TomMartens's avatar
      TomMartens
      Super User

      Hey,

       

      please provide sample data and share the link to your pbix file on onedrive or dropbox.

       

      Regards

      Tom

      • biconsba's avatar
        biconsba
        Frequent Visitor

        Sorry could not find how to attach pbix but it's very easy just create a 3x4 table with data below.

        The purpose is to see influence sales and price change on the revenue measure.

         

        Thanks.

         

        Revenue forecast formula.

         

        Revenue Forecast = SUMx(('Sheet1',[Price]* SELECTEDVALUE('Price change'[Price change]))*([Quantity])* SELECTEDVALUE('Sales Change'[Sales Change], 0))

         

        DATA sample

         

        Revenue forecast report with 2 parameters.