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.
Key | CustomerID | Status | StatusDate | Type | SubType |
1 | 1 | Shipment | 15-03-2020 | Type1 | SubType1 |
2 | 1 | Appeal | 10-02-2020 | Type1 | SubType1 |
3 | 1 | Dispensed | 28-12-2019 | Type1 | SubType1 |
4 | 1 | Trial | 23-11-2019 | Type1 | SubType1 |
5 | 2 | Shipment | 11-03-2020 | Type3 | SubType3 |
6 | 2 | Appeal | 15-12-2019 | Type2 | SubType2 |
7 | 2 | Trial | 18-10-2019 | Type2 | SubType2 |
8 | 3 | Shipment | 15-03-2020 | Type3 | SubType3 |
9 | 3 | Appeal | 10-02-2020 | Type3 | SubType3 |
10 | 3 | Dispensed | 28-12-2019 | Type3 | SubType3 |
11 | 3 | Trial | 23-11-2019 | Type3 | SubType3 |
12 | 4 | Removed | 25-03-2020 | Type1 | SubType2 |
13 | 4 | Shipment | 21-01-2020 | Type1 | SubType2 |
14 | 4 | Appeal | 28-11-2019 | Type1 | SubType1 |
15 | 4 | Shipment | 18-10-2019 | Type1 | SubType1 |
Solved! Go to Solution.
hi @RajeshLM
You could use this two measure
Type CustomerIDCount =
VAR _table = SUMMARIZE(FILTER('Table','Table'[Status]="Appeal"||'Table'[Status]="Shipment"),'Table'[CustomerID],'Table'[Type],
"_value",IF(CALCULATE(MAX('Table'[StatusDate]),FILTER('Table','Table'[Status]="Shipment"))>
CALCULATE(MIN('Table'[StatusDate]),FILTER('Table','Table'[Status]="Appeal"))&&CALCULATE(MIN('Table'[StatusDate]),FILTER('Table','Table'[Status]="Appeal"))<>BLANK(),1,0)) return
SUMX(_table,[_value])
SubType CustomerIDCount =
VAR _table = SUMMARIZE(FILTER('Table','Table'[Status]="Appeal"||'Table'[Status]="Shipment"),'Table'[CustomerID],'Table'[SubType],
"_value",IF(CALCULATE(MAX('Table'[StatusDate]),FILTER('Table','Table'[Status]="Shipment"))>
CALCULATE(MIN('Table'[StatusDate]),FILTER('Table','Table'[Status]="Appeal"))&&CALCULATE(MIN('Table'[StatusDate]),FILTER('Table','Table'[Status]="Appeal"))<>BLANK(),1,0)) return
SUMX(_table,[_value])
Result:
here is sample pbix file, please try it.
Regards,
Lin
hi @RajeshLM
You could use this two measure
Type CustomerIDCount =
VAR _table = SUMMARIZE(FILTER('Table','Table'[Status]="Appeal"||'Table'[Status]="Shipment"),'Table'[CustomerID],'Table'[Type],
"_value",IF(CALCULATE(MAX('Table'[StatusDate]),FILTER('Table','Table'[Status]="Shipment"))>
CALCULATE(MIN('Table'[StatusDate]),FILTER('Table','Table'[Status]="Appeal"))&&CALCULATE(MIN('Table'[StatusDate]),FILTER('Table','Table'[Status]="Appeal"))<>BLANK(),1,0)) return
SUMX(_table,[_value])
SubType CustomerIDCount =
VAR _table = SUMMARIZE(FILTER('Table','Table'[Status]="Appeal"||'Table'[Status]="Shipment"),'Table'[CustomerID],'Table'[SubType],
"_value",IF(CALCULATE(MAX('Table'[StatusDate]),FILTER('Table','Table'[Status]="Shipment"))>
CALCULATE(MIN('Table'[StatusDate]),FILTER('Table','Table'[Status]="Appeal"))&&CALCULATE(MIN('Table'[StatusDate]),FILTER('Table','Table'[Status]="Appeal"))<>BLANK(),1,0)) return
SUMX(_table,[_value])
Result:
here is sample pbix file, please try it.
Regards,
Lin
Thanks Lin. I will implement this logic in my model and let you know.
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 |
---|---|
110 | |
97 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |