Forum Discussion
Count the Result Measure to Create Bar Chart
Hi,
We have data like bleow where Accrual Booked, Actual Work Accrual Value of Work, Accural Calculated and Result are measures created on fronend, and Work Unit and FE Class are table column.
| Work Unit | FE Class | Accrual Booked | Actual Work Accrual | Value of Work | Accrual Calculated | Result |
| 301600 | 105 | 273.24 | 979.75 | 568.63 | 243.19 | Pass |
| 306993 | 105 | 436.6 | 919.45 | 355.57 | 500.85 | Fail |
| 307820 | 105 | 718.84 | 343.5 | 951.73 | 985.49 | Pass |
| 308291 | 105 | 534.79 | 195.62 | 396.75 | 461.87 | Fail |
| 308429 | 105 | 588.93 | 540.06 | 278.7 | 788.87 | Pass |
| 308961 | 110 | 682.56 | 827.43 | 717.94 | 455.23 | Pass |
| 308962 | 110 | 303.39 | 558.82 | 292.06 | 966.26 | Fail |
| 309165 | 205 | 775.87 | 856.5 | 975.73 | 976.75 | Pass |
| 309355 | 105 | 473.51 | 376.9 | 707.35 | 289.37 | Pass |
| 309357 | 105 | 718.09 | 105.72 | 516.78 | 542.13 | Fail |
| 309404 | 110 | 738.12 | 929.66 | 235.01 | 523.45 | Pass |
| 309633 | 110 | 657.6 | 318.92 | 437.16 | 701.22 | Fail |
| 309696 | 105 | 326.00 | 336.73 | 573.86 | 735.23 | Pass |
| 309834 | 105 | 652.22 | 479.43 | 749.98 | 841.46 | Pass |
| 309883 | 105 | 896.75 | 995.59 | 437.5 | 830.61 | Fail |
Now here we want to create the bar chart based on Result with bars of counts of pass and fail. Can anyone please help me with DAX query that will count the pass and fail and we create bar chart out of it. I tried different DAX query but when the same data is taken into table visual the counts were not matching.
Data Fact:
- Work Unit will be unique
- We have one table with only one column having the value {"Pass" and "Fail"}, this we can use on X-axis for bar charts.
Please let me know if you are having any questions.
Thanks,
Bhimashankar
6 Replies
- dharmendars007
Memorable Member
Hello Anonymous ,
I created 2 simple measures where for both "Pass and Fail", you can create Bar chart with this by adding them to x axis..
Pass = CALCULATE(
COUNT('Table'[Work Unit]), 'Table'[Result] = "Pass")Fail = CALCULATE(COUNT('Table'[Work Unit]), 'Table'[Result] = "Fail")If you find this helpful , please mark it as solution and Your Kudos are much appreciated!
Thank You
Dharmendar S
- AnonymousNot applicable
I tried using above measure that is giving the different count than the data in table visual.
- dharmendars007
Memorable Member
Are you looking to have only distinct count of work unit if so you can replace count by distint count.
If you find this helpful , please mark it as solution and Your Kudos are much appreciated!
Thank You
Dharmendar S