Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have two lines of business and I want to summarize values over the combined lines of business. This data lives in the same table but some attributes only apply to one or the other business line. Both lines of business share some common rules which I filter on using calculate in a measure. One of the business lines has a filter unique to it. I am trying to figure out the best way to write a measure that first uses the common filters, but for one line of business add a second filter that won't filter out the rest of the totals for the other business line.
The current measure incorporates only the common filters:
What I have:
TotalSales:=CALCULATE ( SUM(SalesTotal), CommonFilterA= 1, CommonFilterB = 2)
What I need to add:
<Filter Condition> When BusinessLineId = 2 then SUM(TotalSales) where the SalesType = Retail.
I need to add a filter that applies to only one of the two business lines. I need to be able to summarize SalesTotals for both lines of business. I was hoping there was a way I could do this without creating two measures, one for each business line, and then summarizing both. Is there a way to write this in a single DAX statement?
Thanks.
@PBInterest , based on what I got
calculate([TotalSales],filter(Table, [BusinessLineId] <> 2)) + calculate([TotalSales],filter(Table, [BusinessLineId] = 2 && [SalesType] = "Retail" ))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
44 | |
32 | |
30 | |
18 | |
17 |