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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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