Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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" ))
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |