Forum Discussion

Philipp_ISARTAX's avatar
Philipp_ISARTAX
Frequent Visitor
2 years ago
Solved

Sum depending on Letters in Column

Hello all,

I'm a newbie in working with Power BI.

 

Actualy I have a data model with a tble which has in One Row several letters and in another row values.

 

Now I try to create a Measure with DAX-Formula which calculates the sum of the values only for the lines, where the Letter "B" is mentioned in the column of the letters.

 

I tried my best with SUMX or CALCULATE but it doesn't work and I don't understand why.

 

My Measure was:

 = CALCULATE(Sum('Table'[column_values]);'Table'[column_letters]="B")
 
Many thanks for your support!
  • Hello Ahmedx  and Uzi2019 ,

    Thanks for your support. I found the solution.

     

    The data in the table is not "V", it is " V" with a leading Space! This took hours to find out for me 😂
    But I'm happy that it is now working.

     

    Thanks for your support,

    Kind regards,

    Philipp

9 Replies

  • To understand why your measure does not work, share some data

    • Philipp_ISARTAX's avatar
      Philipp_ISARTAX
      Frequent Visitor

      Hello Ahmedx ,

      hello Uzi2019 ,

       

      Please find as follows a screenshot from the table "Abgerechnete Gebühren" from Power Query with the relevant columns:

       

      Here is the Measure and the used DAX-Formula:

       

      I would have expected the summarized total of the columns "Gebührenbetrag mit Mult..." over the lines where the letter "V" is in column "Abrechnungsart Gebühren".

       

      As you can see in the card, the result is empty! 

      • Ahmedx's avatar
        Ahmedx
        Super User

        after the filter must be approved ALL

  • Hello Ahmedx  and Uzi2019 ,

    Thanks for your support. I found the solution.

     

    The data in the table is not "V", it is " V" with a leading Space! This took hours to find out for me 😂
    But I'm happy that it is now working.

     

    Thanks for your support,

    Kind regards,

    Philipp