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

Need help on DAX

Hi,

I have a situation where I want to compare the product price by customer and display the results based on from selected batch and To selected batch as shown below. 

 

I have three different scenarions to complete this report.

1.  Product purchased From Selected Batch but not in To Selected Batch

2. Product purchased To Selected Batch but not in From Selected Batch

3. Product purchased  From and To Selected Batches but the cost is different.
Source Data:

pprasadravi_0-1656426080723.png

Report

pprasadravi_2-1656426144135.png

 

Could you please give me an idea on how I can implement the solution?

 

Thanks

Ravi Potturi

 

 

3 REPLIES 3
pprasadravi
Helper I
Helper I

Hi amitchandak,

Thank you so much for the quick response. I think suggested solution should work for me. I will check it and let you know if I see any issues.

 

Ravi Potturi

amitchandak
Super User
Super User

@pprasadravi , for that, create independent table using distinct values of Batch 

 

Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

 

Then you can have measure like

 

calculate(Sum(Table[Cost]), filter(Table, Table[Batch] in values(Batch1[Batch]) &&  not(Table[Batch] in values(Batch2[Batch]) ) ) )

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

Hi Amit Chandak,

I am exremly sorry for the delayed response.

I think independent table many not work for my scenario. I think I need in memory table that should holds the  data based batch ID selection in the slicer. 

I followed article https://www.sqlbi.com/articles/understanding-data-lineage-in-dax/ but no success. 
Does it make sense?

Thanks

Ravi Potturi

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.