I want to have a Card in Power BI with the result of the select
SELECT TOP 1 [COLUMN] FROM [Table]
GROUP BY [COLUMN]
ORDER BY COUNT([COLUMN]) DESC
How can I do something like this in dax?
I want to have a Card in Power BI with the result of the select
SELECT TOP 1 [COLUMN] FROM [Table]
GROUP BY [COLUMN]
ORDER BY COUNT([COLUMN]) DESC
How can I do something like this in dax?
create in powerbi a new table by dax:
Top1 = TopN(1, VALUES(Table__[Column1]), Table__[CountOf], DESC)
where
CountOf = CountOf = count(Table__[Column1])
this is equivalent the maximum value of [COLUMN], that can be easily obtained with
MAX(Table[COLUMN])
another solution is using LASTNONBLANKVALUE
LASTNONBLANKVALUE(Table[COLUMN], Table[COLUMN])
that returns a scalar, otherwise LASTNONBLANK returns a table of a single row and a single column
LASTNONBLANK(Table[COLUMN], Table[COLUMN])
My problem was solved by making a
SingleLeads = DISTINCTCOUNT(Fact_ProductRequests[COLUMN])
I figure this out after checking that there were repeated values in the column.
It was probably, the desperation that settled in not getting the results I wanted, that made me open this question.
Thank you all.