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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

TRICKY - HASONEVALUE and SUM or Average

Hi Experts

 

From the data in table in the attached file i want to take the first Demand for each Supply (as you can see i have repeating values)

as show in the image below and ignore subseqant repeating values and then i want to plot this on a line graph the grpah is wrong as show with the red circle.

 

My Measure

New Demand = if(HASONEVALUE(Sales[DDate]), CALCULATE(AVERAGE(Sales[Demand])),BLANK())
 
Not giving the expected end result
 

 

BlueWhite111_0-1683734572881.png

 

https://www.dropbox.com/s/womzm0w14ebeley/Sample_.pbix?dl=0 

 

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure. 

new supply = CALCULATE(MIN('Sales'[Supply]),FILTER(ALL('Sales'),'Sales'[DDate]=MAX('Sales'[DDate]))) 

(3) Then the result is as follows.

vtangjiemsft_0-1683856951527.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

1 REPLY 1
v-tangjie-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure. 

new supply = CALCULATE(MIN('Sales'[Supply]),FILTER(ALL('Sales'),'Sales'[DDate]=MAX('Sales'[DDate]))) 

(3) Then the result is as follows.

vtangjiemsft_0-1683856951527.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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