<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic I’m trying to calculate a specific type of what-if scenario in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-m-trying-to-calculate-a-specific-type-of-what-if-scenario/m-p/3899256#M151961</link>
    <description>&lt;H1&gt;What is the project?&lt;/H1&gt;&lt;P&gt;I’m developing a solution to show management our overall risk posture based on data coming in from audits.&amp;nbsp; Each finding has a score associated with it (1=Low 2=Medium, 3=High, 4=Critical, but the score number can be decimal values in between these).&amp;nbsp; Also, these findings have a status, so once they are actually remediated in the wild, they don’t show up on a report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’ve created reports that visually show our average risk score categorized out in several different ways (what type of asset, which overall risk category, etc.).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the other tables has projects, with a one-to-many relationship to the findings (so we can associate multiple findings to a project, which would identify what findings would be remediated if we ran with a proposed project).&amp;nbsp; This is related through an intermediary table FindingsToProjects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We want to show what happens to our overall risk scores when a particular project is run.&amp;nbsp; So for example, if we run project XYZ (which would remediate finding B and finding C), how would our risk score look then?&amp;nbsp; So in the FindingsToProjects table we basically have this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;ProjectName&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;FindingName&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Project XYZ&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Finding B&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Project XYZ&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Finding C&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Project LMN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Finding A&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H1&gt;What is the problem I’m having?&lt;/H1&gt;&lt;P&gt;I thought I had this all figured out, because when I deselect a project in the slicer on the report, the score changes, etc.&amp;nbsp; But what I realized is that it’s now just showing the average risk score of a filtered down set of risks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for example, if this is my data (fictitious, but showing what I’m trying to do):&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;FindingName&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;RiskScore&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;FindingStatus&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;FindingClosedDate&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Finding A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&l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gt;AveRisk = AVERAGE([RiskScore])&lt;/PRE&gt;&lt;P&gt;Would have an overall value of 2.73 (for example, in a Card visual, have this meause displaying Average).&amp;nbsp; Once I filter out the “Closed” in a visual, then the average would be 2.75.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That works fine.&amp;nbsp; It’s when I use the slicer to deselect a project that the problem comes up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If finding B and C are associated to the project “Project XYZ”, right now when I deselect that project in the slider it shows a new risk score of 2.33 (which is show the average of finding D and E, since B and C are filtered out and finding A is closed).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I *WANT* it to display is a score of 1.17 (in other words, Average of: Finding B (with a score of 0 since it would be remediated with that project XYZ), finding C (with a score of 0), finding C (1.33), and finding D (3.33)).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I need to do this using some DAX / meaasures I'm just not thinking of yet, but not sure the best way to do it.&amp;nbsp; (Also, I have full ability to modify the source tables if needed, like adding new columns or whatever).&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!!&amp;nbsp; And thanks in advance!&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2024 14:22:46 GMT</pubDate>
    <dc:creator>LightSQR</dc:creator>
    <dc:date>2024-05-07T14:22:46Z</dc:date>
    <item>
      <title>I’m trying to calculate a specific type of what-if scenario</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-m-trying-to-calculate-a-specific-type-of-what-if-scenario/m-p/3899256#M151961</link>
      <description>&lt;H1&gt;What is the project?&lt;/H1&gt;&lt;P&gt;I’m developing a solution to show management our overall risk posture based on data coming in from audits.&amp;nbsp; Each finding has a score associated with it (1=Low 2=Medium, 3=High, 4=Critical, but the score number can be decimal values in between these).&amp;nbsp; Also, these findings have a status, so once they are actually remediated in the wild, they don’t show up on a report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’ve created reports that visually show our average risk score categorized out in several different ways (what type of asset, which overall risk category, etc.).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the other tables has projects, with a one-to-many relationship to the findings (so we can associate multiple findings to a project, which would identify what findings would be remediated if we ran with a proposed project).&amp;nbsp; This is related through an intermediary table FindingsToProjects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We want to show what happens to our overall risk scores when a particular project is run.&amp;nbsp; So for example, if we run project XYZ (which would remediate finding B and finding C), how would our risk score look then?&amp;nbsp; So in the FindingsToProjects table we basically have this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;ProjectName&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;FindingName&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Project XYZ&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Finding B&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Project XYZ&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Finding C&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Project LMN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Finding A&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H1&gt;What is the problem I’m having?&lt;/H1&gt;&lt;P&gt;I thought I had this all figured out, because when I deselect a project in the slicer on the report, the score changes, etc.&amp;nbsp; But what I realized is that it’s now just showing the average risk score of a filtered down set of risks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for example, if this is my data (fictitious, but showing what I’m trying to do):&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;FindingName&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;RiskScore&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;FindingStatus&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;FindingClosedDate&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Finding A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2.67&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Closed&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;5/6/2024&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Finding B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2.33&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Open&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Finding C&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4.00&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Open&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Finding D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1.33&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Open&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Finding E&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3.33&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Open&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, the measure I created named AveRisk:&lt;/P&gt;&lt;PRE&gt;AveRisk = AVERAGE([RiskScore])&lt;/PRE&gt;&lt;P&gt;Would have an overall value of 2.73 (for example, in a Card visual, have this meause displaying Average).&amp;nbsp; Once I filter out the “Closed” in a visual, then the average would be 2.75.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That works fine.&amp;nbsp; It’s when I use the slicer to deselect a project that the problem comes up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If finding B and C are associated to the project “Project XYZ”, right now when I deselect that project in the slider it shows a new risk score of 2.33 (which is show the average of finding D and E, since B and C are filtered out and finding A is closed).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I *WANT* it to display is a score of 1.17 (in other words, Average of: Finding B (with a score of 0 since it would be remediated with that project XYZ), finding C (with a score of 0), finding C (1.33), and finding D (3.33)).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I need to do this using some DAX / meaasures I'm just not thinking of yet, but not sure the best way to do it.&amp;nbsp; (Also, I have full ability to modify the source tables if needed, like adding new columns or whatever).&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!!&amp;nbsp; And thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 14:22:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-m-trying-to-calculate-a-specific-type-of-what-if-scenario/m-p/3899256#M151961</guid>
      <dc:creator>LightSQR</dc:creator>
      <dc:date>2024-05-07T14:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: I’m trying to calculate a specific type of what-if scenario</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-m-trying-to-calculate-a-specific-type-of-what-if-scenario/m-p/3900737#M152001</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="738611" data-lia-user-login="LightSQR" class="lia-mention lia-mention-user"&gt;LightSQR&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First create a measure to calculate the values of C and D, and then average the measure. Try the following DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AdjustedRiskScore = 
VAR ProjectCount =
    COUNTROWS(
        FILTER(
            'FindingsToProjects',
            'FindingsToProjects'[FindingName] = SELECTEDVALUE('Findings'[FindingName])
        )
    )
RETURN
    IF(
        ProjectCount &amp;gt; 0,
        0, 
        SELECTEDVALUE('Findings'[RiskScore]) 
    )
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;AveRisk = AVERAGEX('Findings','Findings'[AdjustedRiskScore])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 02:50:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-m-trying-to-calculate-a-specific-type-of-what-if-scenario/m-p/3900737#M152001</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-08T02:50:45Z</dc:date>
    </item>
  </channel>
</rss>

