Forum Discussion

Victorsam's avatar
Victorsam
Frequent Visitor
3 years ago
Solved

(Blank) on Card

My 'Transactions' table has the following columns; [Account Type], [Account Group], [Account Name], [Year], [Amount], and [Activity].
I have created a measure to get the revenue of an activity. i.e Sum of [Amount] column filtered by a specific [Activity] and [Account Type]. In this case, account types is "Income" and "Other Income" for "Dairy" activity. 
This is my DAX expression.

Revenue =
CALCULATE(Sum(Transactions[Amount]),FILTER(Transactions, Transactions[Account Type]="Income" && Transactions[Activity]="Dairy" && Transactions[Account Type]="Other Income"))

Problem is when I try to visualize the result on a card. It returns (Blank). Why?
 
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi, 

    Have you tried the below?
    Revenue = CALCULATE(
                             Sum( Transactions[Amount]),
                                      FILTERTransactions
                                              Transactions[Account Type] IN {"Income", "Other Income"}
                                               && Transactions[Activity]="Dairy" 
                                        )
                                )

6 Replies

    • Victorsam's avatar
      Victorsam
      Frequent Visitor

      Sure ghoshabhijeet .
      See photo.
      When I use the DAX Anonymous suggested though, I'm only getting sum for [Account Type]"Income"

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi,

        I would then check if there are trailing spaces in the Activity and Account Type columns. Any spaces or typos would prevent effective filtering.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, 

    Have you tried the below?
    Revenue = CALCULATE(
                             Sum( Transactions[Amount]),
                                      FILTERTransactions
                                              Transactions[Account Type] IN {"Income", "Other Income"}
                                               && Transactions[Activity]="Dairy" 
                                        )
                                )

    • Victorsam's avatar
      Victorsam
      Frequent Visitor

      Hi Anonymous ,
      Thanks for this. The card no longer shows (Blank).
      However, for example, in 2020, the card shows 306,772,172/= as the result. When I check my table, that sum is from [Account Type]"Income" only. 

      Here is a snapshot of my data.