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
orghn
Helper I
Helper I

Help on Measure Selected

Hi Everyone!


I need to select only 1 lab and N products for many Labs. I need to find the price per month of my product (my_price) and compare to the total_prod_price of each prod to find the difference (%) between my product and the others.

 

Sample file: https://www.dropbox.com/s/jh9ctxatt079dvq/Sample%28Updated2%29%20%281%29.pbix?dl=0

orghn_0-1645108201514.png

 

Expected output:

Product A, my _price=1600, total_prod_price = 1100, dif = 1100/1600, month = Oct

Product B, my _price=1600, total_prod_price = 1600, dif = 1600/1600, month = Oct

Product C, my _price=1600, total_prod_price = 2100, dif = 2100/1600, month = Oct

 

 

Thanks!

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

Hi @orghn ,

 

1.but I cant delete that relationship.  You could create a new Lab table for the slicer:

New Table = VALUES(Lab[Lab Name])
Measure = 
var _allProds=SUMMARIZE(FILTER(ALL('Product'),[LabName] =MAX('New Table'[Lab Name])),[ProductName])
return CALCULATE(SUM('Price'[Price]),FILTER(ALLSELECTED('Price'),[Product] in _allProds))
diff = [Measure]/[Total_Prod_Price] 

 

2. And I also need to select N months   So what's your expected when select multiple months?

 

On my side:

Eyelyn9_1-1645492623627.png

 

Best Regards,
Eyelyn Qin
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

3 REPLIES 3
v-eqin-msft
Community Support
Community Support

Hi @orghn ,

 

1.but I cant delete that relationship.  You could create a new Lab table for the slicer:

New Table = VALUES(Lab[Lab Name])
Measure = 
var _allProds=SUMMARIZE(FILTER(ALL('Product'),[LabName] =MAX('New Table'[Lab Name])),[ProductName])
return CALCULATE(SUM('Price'[Price]),FILTER(ALLSELECTED('Price'),[Product] in _allProds))
diff = [Measure]/[Total_Prod_Price] 

 

2. And I also need to select N months   So what's your expected when select multiple months?

 

On my side:

Eyelyn9_1-1645492623627.png

 

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

v-eqin-msft
Community Support
Community Support

Hi @orghn ,

 

Based on my understanding,

  • Select Lab B, the related Product is  B,E
  • Select Product Name A,B,C
  • Since the same Product based on 1 and 2 is B, so my_price=Product B=1600

 

If so,please firstly delete the relationship between Lab Table and Product Table:

Eyelyn9_2-1645414658280.png

Then create the measure:

my price measure = 
var _allProds=SUMMARIZE(FILTER(ALL('Product'),[LabName] =MAX('Lab'[Lab Name])),[ProductName])
return CALCULATE(SUM('Price'[Price]),FILTER(ALLSELECTED('Price'),[Product] in _allProds))

Eyelyn9_3-1645414724536.png

 

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

Hi @v-eqin-msft ,

 

Thanks for your help but I cant delete that relationship. And I also need to select N months

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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