max value
2 TopicsUsing variables to normalize a score is not working
Hi I'm trying to normalize a score by the following DAX formula, where I use a variable table and two variable values. But it is not working as you can see in the screenshot. I get the value 0 for all suppliers. I would expect the value to the left of the column '_Normalize score LT vs AT'. In the screenshot you can see the correct results in the column 'Normaliseret', but this calculation is made of a calculated table and 3 separate measures. So I just try to build these measures (calculations) in to one measure '_normalize score LT vs AT'. I'll appreciate if someone could help me in the right direction? _normalize score LT vs AT = var MaxLTvsAT_table = SUMMARIZE('data-leverandørperformance', [Leverandør ID], "@_pct_LTvsAT", '1. Measure Tabel'[% Lead time vs Aftalt tid]) var pct_LTvsAT = DIVIDE([Gns. LT vs AT],[Gns. Aftalt leveringstid],0) var MaxLTvsAT = maxx(TOPN(1, MaxLTvsAT_table, [@_pct_LTvsAT],ASC),[@_pct_LTvsAT]) return if( pct_LTvsAT<0, 100, 100-(divide(pct_LTvsAT,MaxLTvsAT,0)*100 ) )Solved1.2KViews0likes4CommentsDynamic axis Report Builder Power BI
Hi everybody! Can you help me out with dynamic axis in Power BI report builder? For a report I am building in Power BI report builder, I am creating bar charts and column charts. As you know, charts are dynamic, which causes the issue that sometimes there is not enough room to place the datalabels outside. To solve this matter, I want to create a dynamic axis. The below graph is an example of what I want to achieve. For this graph, everything worked fine. I was able to get the result by the following expression for the MAX value: for my y-axis: =Max(Count(Fields!Matchkey.Value))*1.1 I now want to achieve the same result for a bar chart: But, if I use the same formula to determine the max value for my x-axis, I get the following result: I have two parameters in my report. After selecting the parameter values and running the report, the total Matchkeys in this particular selection is 381. However, it should pick in this case the 117 (= the max value for this graph) and multiply this with 1.1 to create a margin so that the labels fit next to the bar, but it is picking up the total Matchkeys, instead of the Max matchkey count for this selection. Does anyone know how to solve this matter? Formula's I have tried already, are: =MAX(Fields!Matchkey.Value)*1.1 =MAX(Fields!Matchkey.Value)*2 =Count(Fields!Matchkey.Value) =MAX(Count(Fields!Matchkey.Value)) =MAX(Count(Fields!Matchkey.Value)) *1.1 ChatGPT is not helpful unfortunately. As a suggestion it's giving me to create a calculated field that calculates the max value, and then use that in my expression to determine the max value. I could not do that as it gives me the error that you cannot use an aggregate function in a calculated field (COUNT and MAX). It appears the report processes the axes for bar charts differently then for column charts. Does anyone know what I should do? Help is very much appreciated!598Views0likes1Comment