Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hello,
I have below data
| Date | Vehicle NO | In/Out | status |
| 01-01-2023 | 1 | Inbound | comp |
| 02-01-2023 | 2 | Inbound | non-comp |
| 03-01-2023 | 3 | Inbound | non-comp |
| 04-01-2023 | 4 | Outbound | comp |
| 05-01-2023 | 1 | Outbound | non-comp |
| 06-01-2023 | 2 | Outbound | comp |
| 07-01-2023 | 3 | Outbound | comp |
| 08-01-2023 | 4 | Inbound | comp |
| 09-01-2023 | 5 | Outbound | non-comp |
if i use cards for total uniqe vehicle it will give me 5 and for uniqe comp vehicle it will give me 4 but i want data as per last status as i sort data in descending order and delete duplicate vehicles numbers then only there will be 3 Comp vehicles and that is the number i required in cards using measure so any one have any clue regarding calculation i would appreciate it.
Solved! Go to Solution.
Hi @Anonymous ,
You could achieve this by creating two measures.
delete duplicate vehicles numbers = COUNTROWS(FILTER(ALLSELECTED('Table'),[status]="comp"&&[Vehicle NO]=MAX('Table'[Vehicle NO])))
the number you required = CALCULATE(DISTINCTCOUNT('Table'[Vehicle NO]),FILTER(ALLSELECTED('Table'),[delete duplicate vehicles numbers]=1))
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.
Hi @Anonymous ,
You could achieve this by creating two measures.
delete duplicate vehicles numbers = COUNTROWS(FILTER(ALLSELECTED('Table'),[status]="comp"&&[Vehicle NO]=MAX('Table'[Vehicle NO])))
the number you required = CALCULATE(DISTINCTCOUNT('Table'[Vehicle NO]),FILTER(ALLSELECTED('Table'),[delete duplicate vehicles numbers]=1))
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.
@Anonymous
*If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.
| User | Count |
|---|---|
| 50 | |
| 43 | |
| 36 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 139 | |
| 129 | |
| 61 | |
| 59 | |
| 57 |