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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Michieldo
Helper III
Helper III

Comparing prices same table based on filter

Hello,

 

I have one table containing prices of several webshops for different products within different product categories. I would like to present the price difference between a selected webshop and the other webshops.

DateWebshopCategoryProductPrice
01/01/2021ACat AProduct A10
01/02/2021ACat AProduct A10
01/01/2021ACat BProduct B15
01/01/2021BCat AProduct A9
01/01/2021BCat BProduct A9
01/01/2021BCat BProduct B12
01/01/2021CCat ACat6

 

My preferred output table looks like:

DateProductCatWebshop AWebshop BWebshop C
01/01/2021AA014
01/01/2021BA03-

 

And changes depending on the filter on the webshop. Any suggestions how to solve this in DAX?

 

Thanks a lot for your help !

 

Michiel

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Michieldo , With an independent table for Webshop slicer

try a measure like

 

sum(Table[Price]) - sumx(filter(allselected(Table[Webshop]), Table[Webshop] = Selectedvalue(Webshop[Webshop])),[Price])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Michieldo ,

Could you please provide the related caculation logic of your preferred output? Why Webshop A is 0 , Webshop B is  1 and 3 for Product A and B separately and Webshop C is 4 for Product A base on your sample data?

Date Product Cat Webshop A Webshop B Webshop C
01/01/2021 A A 0 1 4
01/01/2021 B A 0 3 -

Best Regards

amitchandak
Super User
Super User

@Michieldo , With an independent table for Webshop slicer

try a measure like

 

sum(Table[Price]) - sumx(filter(allselected(Table[Webshop]), Table[Webshop] = Selectedvalue(Webshop[Webshop])),[Price])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks, almost perfect! Allselected didn't work for me, but using Allexcept() in combination with the columns on which I did want to keep the filters on worked.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.