Hi all,
"Count of Users which are active last month ie have some sale value but inactive this month ie their sale is zero or blank"
Firstly , i have calculated measure for "active users last month sales volume" and "active users this month sales volume " seperately
and make a flag measure to meet my condition using IF such that (active users last month sales volume>0 && active users this month sales volume=0 ) which gives me 1 when the condition satisfied otherwise 0 .
So i have need to count or sum these "1" value obtained from flag measure.
Thanks
Hii,
Thanks for providing this measure but this is not working in my case .
here are the measures which i am trying to find in my case ,Firstly
I have created these measure s such that
------------------------------------------------------------------------------------------
Total active users volume this month = CALCULATE ( SUM(DATA[Sale]), DATEADD ( Calendar[Date], 0, MONTH )
Last Month active users Volume = CALCULATE ( SUM(DATA[Sale]), DATEADD ( Calendar[Date], -1, MONTH )
FlagMeasure = IF([Total active users volume this month]=BLANK() && [Last Month active users Volume]>0,1 ,0)
-------------------------------------------------------------------------------------------
and visualise these measure in matrix on the basis of users.
Now, i have need to count users for which the flag measure has value 1
Users | Feb | March |
1 | 250 | |
2 | 40 | |
3 | 220 | |
4 | 70 | 82 |
5 | 85 | 210 |
6 | 115 | 50 |
7 | 135 | |
8 | 40 | 98 |
9 | 320 | 104 |
10 | 65 | |
11 | 10 | |
12 | 60 | |
13 | 70 | |
22 | 270 | |
23 | 100 | |
24 | 60 | |
33 | 20 | |
34 | 200 | 65 |
45 | 120 | |
77 | 65 | 17 |
78 | 25 |
@Alka735 See the attached file where I have created the test data based on your request, the first thing you need is to create a simple table of Active and NotActive
Then use this measure to count customers
Customers Count =
VAR _CustomerSegments =
ADDCOLUMNS(
VALUES('table'[Users]),
"Segment", [FlagM]
)
VAR _SegmentCustomerCount =
GROUPBY(
_CustomerSegments,
[Segment],
"# Customers", COUNTX ( CURRENTGROUP (), 1 )
)
VAR _Result =
FILTER(
_SegmentCustomerCount,
[Segment] = SELECTEDVALUE('ActiveUsers'[Value])
)
RETURN
MAXX(
_Result,
[# Customers]
)
It is a pity that you did not provide more extensive data for testing, but try what I have given you and tell me about the result
hi,
thanks for the solution but i am sharing measures on which i working.
I want to count the flag measure which has value 1 based on my condition but it is giving me blank value or incorrect value and need to work it for all the slicers.
here are measures----
Thanks
Date | Users | Sale |
30-01-2023 | 26406 | 20 |
13-03-2023 | 5463 | 20 |
30-01-2023 | 5463 | 20 |
18-04-2023 | 2914 | 25 |
18-04-2023 | 2892 | 35 |
16-04-2023 | 13421 | 201 |
18-01-2023 | 555 | 60 |
30-04-2023 | 18543 | 205 |
28-02-2023 | 23190 | 10 |
01-04-2023 | 26515 | 60 |
16-03-2023 | 678 | 1 |
15-03-2023 | 1350 | 150 |
04-04-2023 | 1324 | 330 |
05-04-2023 | 9876 | 10 |
07-01-2023 | 234 | 46 |
06-03-2023 | 1345 | 44 |
18-04-2023 | 777 | 250 |
24-02-2023 | 35218 | 102 |
07-02-2023 | 234 | 88 |
04-01-2023 | 234 | 30 |
29-03-2023 | 21465 | 300 |
26-03-2023 | 21465 | 200 |
10-01-2023 | 19879 | 10 |
26-04-2023 | 1345 | 45 |
11-04-2023 | 1345 | 45 |
03-04-2023 | 1345 | 28 |
28-03-2023 | 1345 | 32 |
24-03-2023 | 1345 | 35 |
18-03-2023 | 1345 | 35 |
18-01-2023 | 28141 | 150 |
28-02-2023 | 28226 | 150 |
31-01-2023 | 33681 | 250 |
28-01-2023 | 15175 | 40 |
19-04-2023 | 30196 | 30 |
28-04-2023 | 25574 | 35 |
24-03-2023 | 901 | 300 |
01-03-2023 | 20535 | 30 |
01-03-2023 | 20535 | 30 |
28-02-2023 | 30245 | 60 |
25-03-2023 | 34573 | 10 |
11-02-2023 | 2450 | 30 |
28-04-2023 | 35533 | 60 |
18-01-2023 | 30067 | 30 |
03-04-2023 | 2078 | 35 |
16-01-2023 | 16234 | 200 |
30-04-2023 | 1234 | 10 |
30-04-2023 | 1345 | 10 |
01-03-2023 | 1066 | 30 |
17-04-2023 | 25605 | 150 |
26-04-2023 | 10664 | 1 |
27-03-2023 | 5525 | 1 |
13-04-2023 | 34630 | 85 |
13-01-2023 | 16599 | 200 |
14-03-2023 | 16208 | 27 |
24-03-2023 | 8470 | 130 |
19-01-2023 | 28768 | 90 |
25-03-2023 | 14031 | 10 |
25-03-2023 | 14291 | 30 |
16-03-2023 | 14402 | 25 |
16-03-2023 | 14336 | 25 |
10-04-2023 | 30173 | 400 |
20-04-2023 | 345 | 45 |
16-02-2023 | 30467 | 45 |
06-02-2023 | 31544 | 5 |
16-02-2023 | 4949 | 60 |
16-02-2023 | 4949 | 60 |
24-04-2023 | 5153 | 40 |
21-04-2023 | 234 | 35 |
22-03-2023 | 345 | 10 |
05-03-2023 | 345 | 30 |
13-02-2023 | 8926 | 2 |
06-01-2023 | 1380 | 175 |
30-04-2023 | 901 | 200 |
30-04-2023 | 901 | 200 |
08-02-2023 | 13810 | 2 |
09-01-2023 | 765 | 30 |
10-03-2023 | 28313 | 5 |
04-02-2023 | 1358 | 30 |
24-02-2023 | 455 | 12 |
23-03-2023 | 193 | 12 |
10-03-2023 | 26437 | 200 |
25-03-2023 | 456 | 30 |
19-02-2023 | 6720 | 62 |
06-04-2023 | 2833 | 10 |
13-01-2023 | 3116 | 30 |
26-03-2023 | 12369 | 60 |
31-03-2023 | 12558 | 10 |
17-03-2023 | 12802 | 10 |
27-03-2023 | 3617 | 80 |
01-02-2023 | 1345 | 45 |
12-02-2023 | 1345 | 35 |
02-03-2023 | 1345 | 54 |
12-03-2023 | 1345 | 52 |
17-04-2023 | 1345 | 35 |
28-02-2023 | 1345 | 35 |
07-02-2023 | 1345 | 38 |
04-02-2023 | 456666 | 55 |
05-03-2023 | 500 | 120 |
12-02-2023 | 27267 | 25 |
18-01-2023 | 27267 | 25 |
Hi,
Thanks for response
here is the sample data for testing.
Users | Sale | Month |
1 | 250 | 2 |
22 | 20 | 2 |
2 | 40 | 3 |
3 | 30 | 2 |
4 | 45 | 3 |
4 | 12 | 3 |
5 | 100 | 3 |
6 | 30 | 3 |
7 | 80 | 2 |
77 | 65 | 2 |
78 | 25 | 3 |
5 | 80 | 3 |
45 | 120 | 3 |
3 | 80 | 2 |
4 | 25 | 2 |
3 | 100 | 2 |
4 | 45 | 2 |
6 | 20 | 3 |
7 | 55 | 2 |
8 | 98 | 3 |
9 | 104 | 3 |
10 | 65 | 3 |
9 | 120 | 2 |
11 | 10 | 3 |
12 | 60 | 3 |
13 | 70 | 3 |
24 | 60 | 3 |
34 | 200 | 2 |
33 | 20 | 3 |
23 | 100 | 3 |
3 | 10 | 2 |
5 | 85 | 2 |
6 | 115 | 2 |
9 | 200 | 2 |
8 | 40 | 2 |
77 | 17 | 3 |
22 | 250 | 2 |
34 | 65 | 3 |
4 | 25 | 3 |
5 | 30 | 3 |
@Alka735 Hi, try it
Total = Sumx( Values('Table'[USERS]),[#FlagMeasure])
or
= IF ( HASONEVALUE( 'Table[USERS]),
[#FlagMeasure],
SUMX(VALUES('Table[USERS]),
[#FlagMeasure]
)
@Alka735 What measure do you use for Flag, in the example you don't have 0 sales
@Alka735 Can you provide sample data for testing?