Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Pillic
Helper II
Helper II

Having trouble with losing context in measures - to show in a line graph

I have fact table like this:

IndexWERKMATNRERSTELDATfckfci
59651H3831009139125.01.20243040,9
59852H7041009139130.01.20243038,4
59879H7041009139131.01.20243042,3
60067H7041009139105.02.20243041,2
60179H7041009237906.02.20243752,8
60497H3831009139114.02.20243037
60495H3831009139114.02.20243042,7
60687H3831009139119.02.20243041,5
60842H7041009139121.02.20243043,3
60975H7041009139123.02.20243040,1
61178H7041009139128.02.20243047,2

 

This are the relationships:

Pillic_0-1741941246486.png

 

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.

Pillic_2-1741944091992.png


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 

 

 

1 ACCEPTED SOLUTION
Deku
Community Champion
Community Champion

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]
)

Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

4 REPLIES 4
Deku
Community Champion
Community Champion

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]
)

Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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
 

Deku
Community Champion
Community Champion

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?


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.