Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TK421
Helper I
Helper I

Lost in counts, summarize etc. when trying to create tables. help needed

Hi all.

 

this is table a

INSTALLSETTINGINSTANCES
onea350
oneb100
onec50
twoa300
twob200

using table a - i want a column that shows me the total instances for an install (INSTALL INSTANCES) and another column that shows me the instances by setting divided by the total instances for install (SCORE) to get to below table b

INSTALLSETTINGINSTANCESINSTALL INSTANCESSCORE
onea35050070%
oneb10050020%
onec5050010%
twoa25040063%
twob15040038%

 

and then finally i need 1 more column that shows me the highest score (TOP SCORE) for each install (table c)

INSTALLSETTINGINSTANCESINSTALL INSTANCESSCORETOP SCORE
onea35050070%70%
oneb10050020%70%
onec5050010%70%
twoa25040063%63%
twob15040038%63%

I have been playing around with calculated tables, sums, distinct counts etc for days..... anyone able to help?

 

1 ACCEPTED SOLUTION

Try this to Top Score:

Top Score = 
VAR _MaxInstances = 
    MAXX(
        ALLSELECTED(T_Instances[SETTING]),
        [Count Instances] // This is a measure of COUNT(T_Instances[Setting]
    )
VAR _SumSettings = [Sum Settings]

VAR _Result = _MaxInstances / _SumSettings
RETURN
    _Result




Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

10 REPLIES 10
TK421
Helper I
Helper I

Almost there - i forgot to mention that the instances is currently just a count column of Setting in the visual,
So i am struggling to translate your measure of Sum Instances - i assume i now need to create a sum or count column or measure as part of the original table so that can be referenced in the measure Sum Instances?

 

I have tried making a column that is just count(Instances) but its value is way off of what it should be when in the visual. i assume it is counting everything and not just the instances for that install

InstallSettingCount of Setting
(Should be same as Sum of Instances)
Sum of InstancesSum InstancesSum SettingsScoreTop Score
Onenullnull242458242458516435540.47%0.23%
OneA2242458242458516435540.47%0.23%
OneB1121229121229516435540.23%0.23%
OneC11714183793141837935164355427.46%0.23%
OneD5606145606145516435541.17%0.23%
OneE3363687363687516435540.70%0.23%
OneF1121229121229516435540.23%0.23%
OneG28634671494346714945164355467.14%0.23%
OneH910910611091061516435542.11%0.23%

Try to switch this funtion SUM(T_Instances[INSTANCES])

To: COUNT(T_Instances[Setting]

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




that worked - but Top Score is not working.. 

this is what is now presented

InstallsettingSum InstancesSum SettingsScoreTop Score
Onenullnull424 28591.75%
Onea24240.47%28591.75%
Oneb14240.24%28591.75%
Onec11742427.59%28591.75%
Oned54241.18%28591.75%
Onee34240.71%28591.75%
Onef14240.24%28591.75%
Oneg28642467.45%28591.75%
Oneh94242.12%28591.75%

Try this to Top Score:

Top Score = 
VAR _MaxInstances = 
    MAXX(
        ALLSELECTED(T_Instances[SETTING]),
        [Count Instances] // This is a measure of COUNT(T_Instances[Setting]
    )
VAR _SumSettings = [Sum Settings]

VAR _Result = _MaxInstances / _SumSettings
RETURN
    _Result




Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Brilliant. Works a treat

 

Do you have any suggestions as to how i could Table Just the Install and Top Score?

InstallTop Score
One70%
Two63%
......
  

I don't understand your question. If you only put the Instal column and the Top Score on a table visual you will have that table





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Long night 😞 - didnt realise it would still work just fine when other columns where then removed. thank you so much for your help. 

You're welcome. Please, next time provide all the information at the beginning for a more effective and faster solution.
Thank you





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




_AAndrade
Super User
Super User

Hi,

Here is my solution:

Measures:

Sum Instances = SUM(T_Instances[INSTANCES])

Sum Settings = 
CALCULATE(
        [Sum Instances],
        ALLSELECTED(T_Instances[SETTING])     
)

Score = [Sum Instances] / [Sum Settings]

Top Score = 
VAR _MaxInstances = 
    CALCULATE(
        MAX(T_Instances[INSTANCES]),
        ALLEXCEPT(T_Instances,T_Instances[INSTALL])
    )
VAR _SumSettings = [Sum Settings]

VAR _Result = _MaxInstances / _SumSettings
RETURN
    _Result


Table configuration:

_AAndrade_0-1711562032213.png


Please let me know if this solve your problem.







Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.