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.
Hi everyone!
So I have created some measures to calculate the difference between some values in two different time stamps. Having the measure that calculates that difference, I would also like to have a measure that counts all the possitive values outputed from that measure. I have tried some stuff out but with no luck. Below I show the measures I've used. Any help would be much appreciated. Let me know if you need any more information.
After Avg KPI Value =
CALCULATE(
AVERAGE('DVI KPI'[KPI value]);
FILTER(
'DVI KPI';
[Snapshot ID] = MAX('Snapshot Date Info'[Snapshot ID])
)
)
Before Avg KPI Value =
CALCULATE(
AVERAGE('DVI KPI'[KPI value]);
FILTER(
'DVI KPI';
[Snapshot ID] = MIN('Snapshot Date Info'[Snapshot ID])
)
)
// I want to count the output of this measure
PBDC Avg KPI Value =
var __Difference = [Before Avg KPI Value] - [After Avg KPI Value]
return
DIVIDE(__Difference; [Before Avg KPI Value])
Hi @Mariusz @rajulshah
I can share just those screenshots just so you can have an idea of the data I'm using.
Hi @Anonymous ,
Just a guess, in the same context for your [After Avg KPI Value] and [Before Avg KPI Value] MAX('Snapshot Date Info'[Snapshot ID]) = MIN('Snapshot Date Info'[Snapshot ID]).
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hello @Anonymous,
You can create another measure:
Total KPI Value =
VAR SummarizedTable =
SUMMARIZE (
'Snapshot Date Info',
'Snapshot Date Info'[Snapshot ID],
"AvgKPIValue", [After Avg KPI Value]
)
RETURN
COUNTX ( FILTER ( SummarizedTable, [AvgKPIValue] > 0 ), [Snapshot ID] )
Hope this helps. Let me know if it doesn't.
Hi @rajulshah
No luck unfortunately. Here's what I got. I made some changes to your formula, like the measure I want to count and the Table that has the actual KPI values I am using in the previous measures
Hello @Anonymous ,
Can you provide sample file?
Hi @rajulshah
Im sorry I can't. The file contains a lot of sensitive information and I've been told I can't share it.
Hi @Anonymous
You will need to first define the grain, let's say your visual has Date and colour columns, your measure would be.
PBDC Avg KPI Value =
SUMX(
SUMMARIZE( 'DVI KPI', 'DVI KPI'[date], 'DVI KPI'[Colour] ),
VAR __Difference =
[Before Avg KPI Value] - [After Avg KPI Value]
RETURN
INT(
DIVIDE( __Difference; [Before Avg KPI Value] ) > 1
)
)
Hi @Anonymous
Try using
VALUES( 'DVI KPI'[Snapshot ID] )
instead of SUMMARIZE()
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
96 | |
80 | |
67 | |
62 |
User | Count |
---|---|
137 | |
106 | |
104 | |
81 | |
63 |