cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Dynamic subtraction based on selection of records

I'm wondering if this is possible in PowerBI. I've attached a screenshot of the data.

 

As users multiselect data in a table, can PowerBI dynamically calculate what the score will be. 

 

For example, if they select the first two items in the list (yellow rows), can PowerBI dynamically calculate that ScoreAfterGroup should be 752?

 

imgmd.PNG


Thanks,

MD

 

 

1 ACCEPTED SOLUTION

@dam0853 try this, make sure to change table name and column name as per your data model.

 

Score After = MAX( Table3[Score] ) - SUM( Table3[Reduce] )





Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

6 REPLIES 6
New Member

You can  do this dynamically using a simple Measure that would serve as both your ScoreAfter in an unsummarized Table and your ScoreAfterGroup as a Card with a Sum aggregation.  Measures are great because they respond to your selection, but there are limitations. See Measure below:

ScoreAfter = AVERAGE(Sheet1[Score]) - SUM(Sheet1[Reduce])

Not sure if this is what you are looking for, more information about the "dynamic" selection and whether the groups have a common criteria  unifying them.  You wouldn't be able to display it dynamically as you are showing in your image as far as I am aware.

@dcampbell321 that didn't seem to work. I used to use the FIXED option in Tableau to provide some type of LOD calc for this based on the ID, but I am at a loss in PowerBI

@dam0853 try this, make sure to change table name and column name as per your data model.

 

Score After = MAX( Table3[Score] ) - SUM( Table3[Reduce] )





Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Super User III
Super User III

@dam0853 so your calulation look like is this

 

for yellow: 820 - (54+14) = 752

for blue   : 820 - (14+14+12) = 780

 

Correct?






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





@parry2k Correct, but I want it to be dynamic, so if I were to select only the first records in the colored sets, it would look like:

 

820-54(first record from yellow dataset)-14(first record from blue dataset) = 752.

 

Make sense?

@dam0853 sure the solution provided by @dcampbell321   will work, only issue it will average out the score if selection is made from two different set of scores. Based on your model that is the best option, or you can use MAX instead of AVERAGE






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors