Forum Discussion

Coelijoeli's avatar
Coelijoeli
Advocate I
11 years ago
Solved

Dax: Filter on true value

Hello community,

 

I have a question.

I'm building a dashboard to show how many blogs there have been delivered in the last month.

I used a excel workbook to import a table which contains information about the subject.

The table contains a column which describes if a blog has been deliverd to marketing or not

The values in this column are True and False.

 

Now what I want to do is sum the True Values to get a total of blogs that have been deliverd.

I tried the following Dax formule:

 

Total = COUNTAX(FILTER(Blogs;Blogs[Juni Ingeleverd]=1);Blogs[Juli Ingeleverd])+
COUNTAX(FILTER(Blogs;Blogs[Juli Ingeleverd]=1);Blogs[Juli Ingeleverd])+
COUNTAX(FILTER(Blogs;Blogs[Augustus Ingeleverd]=1);Blogs[Augustus Ingeleverd])+
COUNTAX(FILTER(Blogs;Blogs[September Ingeleverd]=1);Blogs[September])

 

This doesn't work though. I can't seem to find the right value to place in the filter or can't find the right Dax formule to peform this sum.

 

Does anyone have a idea of how I can solve this problem?

 

Thnx,

Joël

 

 

  • konstantinos's avatar
    konstantinos
    11 years ago

    If I understand correct you have months in columns...This willmake it difficult to calculate & filter by month..First you need to unpivot the columns ( in query editor select all months columns & then 'Unpivot Columns' . End up with months (Juni Ingelvard , Juli Ingelvardin ) in Atrribute column and True or False in Value column..

     

    BlogSent = CALCULATE( COUNTROWS ( Blog ) ; Blog[Value] = TRUE ) ..

     

    Create the column chart with Attribute ( months ) as axis and BlogSend as values

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    If the values are truly "True" and "False" in your column, then you would need to use Blogs[Juni Ingelvard]="True".

    • konstantinos's avatar
      konstantinos
      Memorable Member

      If I understand correct you have months in columns...This willmake it difficult to calculate & filter by month..First you need to unpivot the columns ( in query editor select all months columns & then 'Unpivot Columns' . End up with months (Juni Ingelvard , Juli Ingelvardin ) in Atrribute column and True or False in Value column..

       

      BlogSent = CALCULATE( COUNTROWS ( Blog ) ; Blog[Value] = TRUE ) ..

       

      Create the column chart with Attribute ( months ) as axis and BlogSend as values