The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello,
I have a table like below:
Name Year Dist Comments
MPR 2022 3 Y
MPR 2023 2 Y
MPR 2020 8 N
NWS 2020 6 Y
NWS 2019 5 Y
PER 2018 7 Y
PER 9 Y
PER 2016 4 N
PER 2016 1 Y
I want to have my visualization table to only display the rows with the most recent year for every Name.
My visualization table output as below:
Name Year Dist Comments
MPR 2023 2 Y
NWS 2020 6 Y
PER 2018 7 Y
Thank you.
Solved! Go to Solution.
Hi,
These measures work
Last year = MAX(Data[Year])
Dist in last year = CALCULATE(MIN(Data[Dist]),FILTER(VALUES(Data[Year]),Data[Year]=MAX(Data[Year])))
Comment in last year = CALCULATE(MIN(Data[Comments]),FILTER(VALUES(Data[Year]),Data[Year]=MAX(Data[Year])))
Hope this helps.
Hi,
These measures work
Last year = MAX(Data[Year])
Dist in last year = CALCULATE(MIN(Data[Dist]),FILTER(VALUES(Data[Year]),Data[Year]=MAX(Data[Year])))
Comment in last year = CALCULATE(MIN(Data[Comments]),FILTER(VALUES(Data[Year]),Data[Year]=MAX(Data[Year])))
Hope this helps.
@Anonymous , refer if my blog on the same topic can help
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
User | Count |
---|---|
69 | |
69 | |
66 | |
54 | |
28 |
User | Count |
---|---|
112 | |
82 | |
66 | |
48 | |
43 |