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.
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 |
---|---|
70 | |
67 | |
63 | |
50 | |
28 |
User | Count |
---|---|
113 | |
78 | |
64 | |
55 | |
44 |