Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

If condition using measure

Hi,

 

I have following available;

  • A measure: Net Revenue = Sum(Revenue[Amount])
  • A customer Table related to Sales (Cross filter direction - Both)

 

 Required Visual(Matrix)

 

CustomerNet RevenueStatus
C1100Positive
C2125Positive
C3200Positive
C4-60Negative
C50Blank

 

One way to have Status column is a new measure:

Status = If([Net Revenue]>0,"Positive",If([Net Revenue]<0,"Negative","Blank")))

 

However, It's exceed the limit of resource.

 

Is there any other way we can have the Status column? 

Note - There will be more coulmns to be added to the matrix and we cannot do any changes to the data sets.

 

 

 

3 Replies

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    hi, Anonymous 

    I think the formula is the simplest.

    and if you could use this formula:

    Status 2 = SWITCH(TRUE(),
    [Net Revenue]>0,"Positive",
    [Net Revenue]<0,"Negative",
    "Blank")

    and if you could use slicer to filter some data.

     

    Best Regards,

    Lin

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Lin,

       

      I have already used the Switch. Not helpful.

      "Resources Exceeded"

       

      Thanks,

      Raman

      • v-lili6-msft's avatar
        v-lili6-msft
        Community Support

        hi, Anonymous 

        the issue occurs when a visual has attempted to query too much data for the server to complete the result with the available resources. 

        As suggested in the error, you may need to try filtering the visual to reduce the amount of data in the result currently.

        For building fast and reliable reports in Power BI. Please refer to “Power BI Performance Best Practices “

         

        If possible, could you share the sample pbix file for us have a test.

         

        Best Regards,

        Lin