Forum Discussion

plantbean's avatar
plantbean
Frequent Visitor
5 years ago
Solved

Adding measures based on value

I have a few different tables: Fake Doc 1, Fake Doc 2, Fake Doc 3. These all have some values in it. I've created three different risk measures for each of the tables - so Doc 1 Risk, Doc 2 Risk, Doc 3 Risk. In these I've summed the document values and gave it a 1, 2, or 3 score based on what I've considered is its low, medium, and high risk score. (High risk would be the sum < 40, medium < 70, etc)

 

What I would like to do next is create a measure, Count Lows, for example, that will be a sum of all the low risk scores. Then a Count Medium, and Count High. This way I can display how many low/medium/high risk scores we have. 

 

How can I sum different measures if it's equal to a certain value? This could be done if loops were a thing in DAX but I'm having a hard time adjusting to this language. There's only 3 docs in this example, but the final state would probably have much more than just 3 document tables. 

  • I wasn't able to figure it out in Power BI so I instead calculated risk on the excel sheet first and then summed it using a measure with something like this:

    CALCULATE(COUNTA('Doc 1'[]),FILTER('Documents', Documents[Doc Risk]==3))

     

2 Replies