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.
"Dear community,
I want to calculate dealers count on basis of some criteteria :-
Count of those dealers who achevied their 0 to 20 % of target data .
Count of those dealers who achevied their 20 to 50 % of target data .
Count of those dealers who achevied their 50 to 80 % of target data .
Count of those dealers who achevied their 80 to 100 % of target data .
Count of those dealers who achevied more than 100% of target data .
I also calculate mothly achievement of deales from this measure
MTD = TOTALMTD(SUM(CUBE_INVOICE[INVOICE QUANTITY]),'Calendar_new'[Date])
And same for the deales monthly target
MTD target = TOTALMTD(SUM(CUBE_TARGET[TARGET QUANTITY]),'Calendar_new'[Date])
Now what measure write for achieveing those criteria if i have sample data like this -
here in single date have many values of dealer target and sales
For this i have to data tables
(1) Cube_invoice
Date | Dealer | invoice quantity/sales |
12-08-22 | a,b,c,d,e | 50,60,80,70,98 |
12-09-22 | a,b,c,d,e | 52,80,25,12,10 |
12-10-22 | a,b,c,d,e | 10,200,50,70,48 |
12-11-22 | a,b,c,d,e | 10,60,30,70,28 |
12-12-22 | a,b,c,d,e | 40,60,80,20,35 |
(2) Cube_Target
Date | Dealer | Target quantity/sales |
12-08-22 | a,b,c,d,e | 100,150,160,200,100 |
12-09-22 | a,b,c,d,e | 100,150,160,200,100 |
12-10-22 | a,b,c,d,e | 100,150,160,200,100 |
12-11-22 | a,b,c,d,e | 100,150,160,200,100 |
12-12-22 | a,b,c,d,e | 100,150,160,200,100 |
Please help."
First step is to bring your data into a usable format
Date | Dealer | Invoice | Target |
2022-12-08 | a | 50 | 100 |
2022-12-08 | b | 60 | 150 |
2022-12-08 | c | 80 | 160 |
2022-12-08 | d | 70 | 200 |
2022-12-08 | e | 98 | 100 |
2022-12-09 | a | 52 | 100 |
From there your measures will be much easier.
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
27 | |
12 | |
12 | |
10 | |
6 |