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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have a calculate column which is basically calculating max date per ID then saying if the date equals the latest date it gives me 0 or 1 then i filter my table to this, below are my currentl calculations;
Solved! Go to Solution.
Hi @Anonymous,
Sorry for the late reply.
Create a measure as below:
Measure 2 =
CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(ALL('Table'),'Table'[Date] in FILTERS('Date table'[Date])&&'Table'[Country]=MAX('Table'[Country])))
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi @Anonymous ,
First create a date table as below:
Date table = VALUES('Table'[Date])
Then create an index column in query editor and a measure as below:
Measure =
var _maxdates=CALCULATETABLE(VALUES('Table'[Date]),FILTER(ALL('Table'),'Table'[ID]=MAX('Table'[ID])&&'Table'[Date]<=SELECTEDVALUE('Date table'[Date])))
var _maxdate=MAXX(_maxdates,[Date])
VAR _index=CALCULATETABLE(VALUES('Table'[Index]),FILTER(ALL('Table'),'Table'[ID]=MAX('Table'[ID])&&'Table'[Date]=_maxdate))
Return
IF(MAX('Table'[Index]) in _index,1,0)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
@v-kelly-msft thank you for coming back, i have 1 issue i am trying to display this in a bar chart so country is the axis and the value is a count of the how many Ids (based on latest date) fall into that country bracket. But can't seem to get this working
@Anonymous , Not very clear.
Try a measure like
if(min('Country'[Date]), = calculate(min('Country'[Date]), ALLEXCEPT('Country','Country'[ID])),1,0)
@amitchandak thank you for coming back, i have 1 issue i am trying to display this in a bar chart so country is the axis and the value is a count of the how many Ids (based on latest date) fall into that country bracket. But can't seem to get this working.
Hi @Anonymous,
Sorry for the late reply.
Create a measure as below:
Measure 2 =
CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(ALL('Table'),'Table'[Date] in FILTERS('Date table'[Date])&&'Table'[Country]=MAX('Table'[Country])))
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
User | Count |
---|---|
98 | |
76 | |
76 | |
49 | |
27 |