Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have fact table like this:
Index | WERK | MATNR | ERSTELDAT | fck | fci |
59651 | H383 | 10091391 | 25.01.2024 | 30 | 40,9 |
59852 | H704 | 10091391 | 30.01.2024 | 30 | 38,4 |
59879 | H704 | 10091391 | 31.01.2024 | 30 | 42,3 |
60067 | H704 | 10091391 | 05.02.2024 | 30 | 41,2 |
60179 | H704 | 10092379 | 06.02.2024 | 37 | 52,8 |
60497 | H383 | 10091391 | 14.02.2024 | 30 | 37 |
60495 | H383 | 10091391 | 14.02.2024 | 30 | 42,7 |
60687 | H383 | 10091391 | 19.02.2024 | 30 | 41,5 |
60842 | H704 | 10091391 | 21.02.2024 | 30 | 43,3 |
60975 | H704 | 10091391 | 23.02.2024 | 30 | 40,1 |
61178 | H704 | 10091391 | 28.02.2024 | 30 | 47,2 |
This are the relationships:
then I created a measure to have the average of fck by "werk" and "matnr":
mfck =
CALCULATE(
AVERAGE(FCT_STRENGTH[fck]),
ALLSELECTED(FCT_STRENGTH),
VALUES(FCT_STRENGTH[WERK]),
VALUES(FCT_STRENGTH[MATNR])
)
And the same for the fci, also by "werk" and "matnr":
mfci =
CALCULATE(
AVERAGE(FCT_STRENGTH[fci]),
ALLSELECTED(FCT_STRENGTH),
VALUES(FCT_STRENGTH[WERK]),
VALUES(FCT_STRENGTH[MATNR])
)
Then I needed the folowing measure, where each fci - mfci (from the previous measure) is calculated:
MW-Transf =
VAR fci =
SELECTEDVALUE ( FCT_STRENGTH[fci] )
VAR mfci = [mfci]
RETURN
fci - mfci
And finally a calculation with all measures like this:
Ist-Transf =
[MW-Transf] + [mfci] - [mfck]
All of these are working fine in a table view combined with all measure and the fci
but the orange table shows the desired result for the line graph and here are the duplicate dates combined - which is wrong.
For my understanding it looses the context of the fci.
I tried with the dates from the date table, tried to involve the index, but all is failing.
Is it anyway possible to show the desired complete final measure (Ist-Transf) on a y axis and a date on the x axis in a line graph?
Any help is much appreciated.
KR
Solved! Go to Solution.
Assumed you'd want the average since that is what you are using in the other measures
MW-Transf =
AVERAGEX(
SUMMARIZE( FCT_STRENGTH, FCT_STRENGTH[index], FCT_STRENGTH[fci] )
,FCT_STRENGTH[fci] - [mfci]
)
Assumed you'd want the average since that is what you are using in the other measures
MW-Transf =
AVERAGEX(
SUMMARIZE( FCT_STRENGTH, FCT_STRENGTH[index], FCT_STRENGTH[fci] )
,FCT_STRENGTH[fci] - [mfci]
)
Hello Deku,
your answer was a step into the right direction. So I will mark it as solution.
With your measure I used the predefined visual calulation with moving average. Which does not reflect the requirement of showing each value, but is good enough at the moment.
Thank you
In your 3rd measure we are using SELECTEDVALUE ( FCT_STRENGTH[fci]) which returns blank if more than one value. Your have two fci values for that date. Do you want sum the fci together for that date together of calculate per fci value?
The desired output would be each fci calculated by date, even if there are multiple fci on the same date.
Is that possible? perhaps with the index which is unique.
User | Count |
---|---|
84 | |
76 | |
74 | |
48 | |
39 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |