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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Haldmir
New Member

How do I do calculate with my filters referencing a column of values depending on another column?

 

5-19-2018 11-38-18 AM.jpgI have a business scenario where I want to calculate the attach rate of my add on business to my main packaged sales. Below is a sample data set of my product hierarchies.

 

Depending on markets, some markets will attach Main Packaged Business to Add Ons differently. Scenario below

 

A: 1, 2, 3,5, 7

B: 6,7,8,9

C: 5,6,7

 

How do I filter the add ons in the CALCULATE() function such that it can scale based on an end user input of whether is it 1 ,2 ,3 and so forth?

 

Add ons and business hiearchies are all text based values.

 

4 REPLIES 4
anandav
Skilled Sharer
Skilled Sharer

@Haldmir,

 

In the example you have given you are missing a table in your data model for Market where you need to list the Main Package and related Ad-Ons. Without that how do you what package is tied to which ad-ons?

 

Also you your question is not very clear so can you explain a bit more on what you are trying to achieve?

@anandav,

 

Yes, assume that I have a related table as below.

5-19-2018 10-13-36 PM.jpg

 

I'm trying to achieve the below result but am struggling to find the write DAX formula and how to write it.5-19-2018 10-22-09 PM.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I'm looking for a way to calculate my fact Main Business Sales table such that it conditionally sums based on the add on it is calculating against. After which, to divide the add on sales by the conditionally sum main business sales to derive the attach rate.

 

My fact table consists of sales at a SKU/market level and the differentiator between Main Business sales or Add On sales is determined by one of the many product hierarchies called Business Type where Business Type = A, B, C, D, E, 1, 2, 3, 4, 5

@Haldmir,

 

Hope the below solution helps.

I am making some assumptions about how your product and ad-on prices are modelled.

 

1. Create a Table visual with Package ID from the combined table.

2. Then create the Measures as shown in below diagram.

 

Product Packages.jpg

 

The data model is:

ProductPackages.JPG

If this solves your problem, please mark it as the solution.

 

@anandav, how is related main products linked to all the final calculation? I can't get it to work as intended as it is not summing up the main packaged base numbers correctly.

 

Anyway, i'm not looking for price. My sales data is sales quantity.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.