Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello everyone!
I have a simple form collecting a daily report of activities being accomplished.
Data example:
| Day | Submitter | Activity 1 | Activity 2 | Activity 3 |
| 1/3/2020 | agent1 | true | true | false |
| 1/3/2020 | agent2 | true | false | false |
| 1/3/2020 | agent3 | false | true | false |
| 2/3/2020 | agent1 | false | true | true |
| 2/3/2020 | agent2 | false | false | false |
| 2/3/2020 | agent4 | true | true | false |
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
Solved! Go to Solution.
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'
Proud to be a Datanaut!
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'
Proud to be a Datanaut!
Thank you all! After I transformed the field to numeric everything was easy.
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |