Forum Discussion

danielec's avatar
danielec
New Member
6 years ago
Solved

Chart for multiple boolean columns

Hello everyone!

I have a simple form collecting a daily report of activities being accomplished.

 

Data example:

DaySubmitterActivity 1Activity 2Activity 3
1/3/2020agent1truetruefalse
1/3/2020agent2truefalsefalse
1/3/2020agent3falsetruefalse
2/3/2020agent1falsetrue

true

2/3/2020agent2falsefalsefalse
2/3/2020agent4truetruefalse

and so on...

 

I'd like to have a barchart with the count of "true" for each activity during a specified time period (single or multiple days). It would also be useful a timechart with Activity1, 2 ... and so on as series and the count of each one accomplished per day.

 

Is it possible?

 

Thanks in advance!

Daniele

 

  • Hi danielec ,

     

    As Greg_Deckler said above, boolean can be a bit of a PITA in measures.
    If you are able to convert your data to text the following measure should work fine for each activity:

     

     

    _activity1qty = 
    CALCULATE(
        COUNT('table'[Activity 1]),
        'table'[Activity 1] = "TRUE"
    )

     

     

    Once you have the three measures, stick them in a stacked column like this:

     

    Stacked Column Chart - three measures all in 'Values', Day in 'Axis'

     

     

3 Replies

  • Hi danielec ,

     

    As Greg_Deckler said above, boolean can be a bit of a PITA in measures.
    If you are able to convert your data to text the following measure should work fine for each activity:

     

     

    _activity1qty = 
    CALCULATE(
        COUNT('table'[Activity 1]),
        'table'[Activity 1] = "TRUE"
    )

     

     

    Once you have the three measures, stick them in a stacked column like this:

     

    Stacked Column Chart - three measures all in 'Values', Day in 'Axis'

     

     

    • danielec's avatar
      danielec
      New Member

      Thank you all! After I transformed the field to numeric everything was easy.

       

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Yeah, I believe that COUNTA will count boolean values. Could also use COUNTROWS. Believe it or not, I often find annoying limitations with boolean things in Power BI so I tend to use 1's and 0's instead.