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

Calculate the difference between mean averages with taking into account blank data

Hello everyone,

 

I want to create a measure which subtracts the AVERAGE GAP between two prices from different tables. i mean average GAP because there might be more than two prices within a day.

 

The tables are:

    

DatePrice Product A
01-feb1,2
05-may1,3
06-ago1,09
06-ago1,1
07-sep1,5

        

DatePrice Product B
01-feb0,9
05-may1,05
06-ago0,8
06-ago0,75
12-nov 0,7

   

Date Average Price AAverage Price B
01-feb1,2  0,9
05-may1,31,05
06-ago1,095 0,775
07-sep1,5-
12-nov0,7

The expected GAP should be:

DateGAP Averages
01-feb 0,30
05-may0,25
06-ago0,32
07-sep0
12-nov  0 

  

In September 7th and November 12th I DONT wanna have these averages calculated or shown on my graph.

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create a common date Table, then have measures like

 

A1= Average(Table1[Price Product A])

 

B1 = Average(Table2[Price Product B]) 

 

 

diff = if([A1] = [B1], blank(), [A1] - [B1])

 

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Create a common date Table, then have measures like

 

A1= Average(Table1[Price Product A])

 

B1 = Average(Table2[Price Product B]) 

 

 

diff = if([A1] = [B1], blank(), [A1] - [B1])

 

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda

Anonymous
Not applicable

Hello,

 

Thank you! It has helped me out. One last question. If I want to avoid negative results, how may I?

 

 

Anonymous
Not applicable

Hello @amitchandak 

 

It has helped me out. One last question. If I want to avoid negative results, how may I?

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.