Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello,
I'm trying to create a visual to show the average month over month for each priority.
If you look at this photo below this shows the data I'm working with:
For each month within the year I need to show the total for each priority and the percentage of met. Feb for example would show: 27 for the total and 81% for the met. I believe this could be done by creating new columns within the dataset and using IF statements to make them a 1 or 0 after which performing an add and divide. However, I believe there is an easier way.
Thank you for your help!
Solved! Go to Solution.
Hi @Anonymous
try measures
Total for priority = CALCULATE(SUM(Table[Count of Incident Number]), ALLEXCEPT(Table, Table[Year], Table[Month], Table[Priority]) )
and
%Met =
DIVIDE(
CALCULATE(SUM(Table[Count of Incident Number]), ALLEXCEPT(Table, Table[Year], Table[Month], Table[Priority]), Table[Met MTTR] = TRUE() ),
[Total for priority]
)
Hi @Anonymous
try measures
Total for priority = CALCULATE(SUM(Table[Count of Incident Number]), ALLEXCEPT(Table, Table[Year], Table[Month], Table[Priority]) )
and
%Met =
DIVIDE(
CALCULATE(SUM(Table[Count of Incident Number]), ALLEXCEPT(Table, Table[Year], Table[Month], Table[Priority]), Table[Met MTTR] = TRUE() ),
[Total for priority]
)
Hi @az38,
This is very helpful! I did hit a little bit of a snag with this. It appears this requires a measure within a measure for me to get the count of incident number. I've created a measure to perform that; however, I'm getting the below error:
Hi @Anonymous
for using measure inside SUM() try SUMX() function like
Total for priority = CALCULATE(SUMX(Sheet1, [Count of Incident Number]), ALLEXCEPT(Sheet1, Sheet1[Year], Sheet1[Month], Sheet1[Priority]) )
@Anonymous
You tried to use SUM that does not need a table but can work only with Columns
SUMX(), COUNTX, AVERAGEX() are working with expressions. you can read here https://docs.microsoft.com/en-us/dax/sumx-function-dax
| User | Count |
|---|---|
| 57 | |
| 44 | |
| 32 | |
| 16 | |
| 14 |
| User | Count |
|---|---|
| 84 | |
| 70 | |
| 38 | |
| 27 | |
| 24 |