Hi @Ritaf1983
Thanks for noticing! 😁 It's always great to see you around too.
Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I'm struggle to get this measure figured out.
I have data that includes a "# of reponses" for a month, and then a total score for a particular item. That looks like something like the below.
Now, in order for me to get the correct 3 month score, I need to multiple each months score by the reponse. Then take that total divided by the total of the reponses. And with some quick excel work, you can see the 3 month scores should be 71.1
I've been struggling with the Measure, and believe I need to use ISINSCOPE to correclty manipulate the total, but can't get this to work correctly yet.
Score =
VAR TotalScore = Sum(SampleScores[Org Score]) * CALCULATE(Sum(SampleScores[Org Score]), SampleScores[Description] = "# of responses")
RETURN
SWITCH(
TRUE(),
ISINSCOPE(SampleScores[Month]), Sum(SampleScores[Org Score]),
DIVIDE(
TotalScore,
Calculate(Sum(SampleScores[Org Score]), SampleScores[Description] = "# of responses")
)
)
Solved! Go to Solution.
Hi @ptmuldoon
The best practice for working with Power BI is to have separate columns for separate measures in the data table:
To achieve this you should pivot the columns in power query :
then you can create a date table + relationship with your "fact table"
Then create a 3 measures :
The pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hi @ptmuldoon
As what @Ritaf1983 has mentioned, it is a best practice to have a separate column for each measure because If your table isn't the proper shape, you'll end up with a lengthy DAX 😊
Score =
VAR _responses =
CALCULATE (
SUM ( 'Table'[Org Score] ),
KEEPFILTERS ( 'Table'[Description] = "# of responses" )
)
VAR _intent =
CALCULATE (
SUM ( 'Table'[Org Score] ),
KEEPFILTERS ( 'Table'[Description] = "Intent to Recommend (Property)" )
)
VAR _total = _responses * _intent
VAR CellTotal =
SUM ( 'Table'[Org Score] )
VAR IntentTotal =
AVERAGEX ( VALUES ( 'Table'[Month] ), CALCULATE ( SUM ( 'Table'[Org Score] ) ) )
VAR GrandTotal =
SUMX (
ADDCOLUMNS (
SUMMARIZE ( 'Table', 'Table'[Month] ),
"@total",
CALCULATE (
SUM ( 'Table'[Org Score] ),
KEEPFILTERS ( 'Table'[Description] = "# of responses" )
)
* CALCULATE (
SUM ( 'Table'[Org Score] ),
KEEPFILTERS ( 'Table'[Description] = "Intent to Recommend (Property)" )
)
),
[@total]
)
VAR result =
SWITCH (
TRUE (),
SELECTEDVALUE ( 'Table'[Description] ) = "Intent to Recommend (Property)", IntentTotal,
SELECTEDVALUE ( 'Table'[Description] ) = "# of responses", CellTotal,
GrandTotal
)
RETURN
result
@danextian
Looks like we’re syncing thoughts in the forum lately 😊 It's Always great to see you around!🙃
Hi @Ritaf1983
Thanks for noticing! 😁 It's always great to see you around too.
Hi @ptmuldoon
The best practice for working with Power BI is to have separate columns for separate measures in the data table:
To achieve this you should pivot the columns in power query :
then you can create a date table + relationship with your "fact table"
Then create a 3 measures :
The pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Thanks.
I ended up modifying the import to add some additional column to compute the 'raw score' there, and then simplified the measure. Not sure why I didn't think of that earlier.
And I'll be adding this into a larger dataset that already had the Date Table set up, etc.
Hi @ptmuldoon ,
Try this. Of course, replace any incorrect fields with your fields:
Score =
VAR _Description = SELECTEDVALUE(SampleScores[Description])
// Generate results, one for each description
VAR _SummarizeMe =
SUMMARIZE(SampleScores, [Month],
"@Responses", CALCULATE(SUM(SampleScores[Org Score]), KEEPFILTERS(SampleScores[Description] = "# OF RESPONSES")),
"@Scores", CALCULATE(SUM(SampleScores[Org Score]), KEEPFILTERS(SampleScores[Description] = "SCORES"))
)
RETURN
// check to see if current row context matches string
SWITCH( _Description,
"# OF RESPONSES", SUMX(_SummarizeMe, [@Responses]),
"SCORES", SUMX(_SummarizeMe, [@Scores]),
// if not, must be the row total line, let's multiple everything
SUMX(_SummarizeMe, [@Responses] * [@Scores])
)
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
| User | Count |
|---|---|
| 50 | |
| 41 | |
| 32 | |
| 26 | |
| 24 |
| User | Count |
|---|---|
| 130 | |
| 128 | |
| 59 | |
| 45 | |
| 45 |