cancel
Showing results for
Did you mean:
Helper I

## Help needed with measure

Hi all,

I need help with a simple measure, but I don't get it working...
I have a dataset with Producttype - current month and Producttype - last month and numbers.
It shows the number of customers going from Producttype - lastmonth into Producttype - current month.
Now I want to built an overview which shows a measure with the aggregated numbers per Producttype - current month and the aggregated numbers per Producttype - last month.

See for an example below:

 Producttype - current month Producttype - last month Count A A - B 29 A A - C 2.882 A A - D 1.618 A A - D - B 3 A A - D - C 4.843 A A - D - C - B 3 A D 56 A - B A 1.142 A - B A - C 6 A - B A - C - B 3 A - B A - D 6 A - B A - D - B 41 A - B A - D - C 6 A - B A - D - C - B 30 A - B D - B 1 A - C A 2.734 A - C A - C - B 5 A - C A - D 42 A - C A - D - C 769 A - C D 3 A - C - B A 3 A - C - B A - B 4 A - C - B A - C 376 A - C - B A - D - C 4 A - C - B A - D - C - B 13

 Producttype - current month Count - IN A 9.434 A - B 1.235 A - C 3.553 A - C - B 400

 Producttype - last month Count - OUT A 3.879 A - B 33 A - C 3.264 A - C - B 8

I've made a combination of calculations but now I only have the total in every row and not every row specified.

COUNT - IN =
CALCULATE(
SUM([COUNT]),
'Table'[Producttype - current month] = "A",
'Table'[Producttype - last mont] <> "A"
)
+
CALCULATE(
SUM([COUNT]),
'Table'[Producttype - current month] = "A - B",
'Table'[Producttype - last mont] <> "A - B"
)
+
etc....
1 ACCEPTED SOLUTION
Community Support

Hi @Sander1401 ,

I can probably understand your idea from the formula you provided, but I don't correspond to your desired result. I don't know what you expect, such as 9.434 is calculated from the sample data.

For now, you may try this measure

``````COUNT - IN =
CALCULATE (
SUM ( 'Table'[Count] ),
FILTER (
ALLSELECTED ( 'Table' ),
[Producttype - current month] = MAX ( 'Table'[Producttype - current month] )
&& [Producttype - current month] <> [Producttype - last month]
)
)
``````

Best Regards,

Stephen Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support

Hi @Sander1401 ,

I can probably understand your idea from the formula you provided, but I don't correspond to your desired result. I don't know what you expect, such as 9.434 is calculated from the sample data.

For now, you may try this measure

``````COUNT - IN =
CALCULATE (
SUM ( 'Table'[Count] ),
FILTER (
ALLSELECTED ( 'Table' ),
[Producttype - current month] = MAX ( 'Table'[Producttype - current month] )
&& [Producttype - current month] <> [Producttype - last month]
)
)
``````

Best Regards,

Stephen Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### 2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors