Forum Discussion
NilR
4 years agoPost Patron
SelectColumns with distinct count not working
How to sum(count) considering duplicates in YYYYMM, so the total should be 9 not 11.
SELECTCOLUMNS(
FILTER('TABLE',([DATE]>= Min_Date && [DATE]<= Max_Date) && [CATEGORY]=_CAT && [COUNT] > 0 ),"CAT", [CATEGORY],"_ID",_ID], "DATE", [YYYYMM],"_CTC",COUNTROWS(DISTINCT('TABLE'[YYYYMM]))
)
Hi,
Drag Measure 2 to a card visual
Measure 1 = min(Data[Count])
Measure 2 = SUMX(values(Data[YYYYMM]),[Measure 1])
Hope this helps.
4 Replies
- Ashish_MathurSuper User
Hi,
Drag Measure 2 to a card visual
Measure 1 = min(Data[Count])
Measure 2 = SUMX(values(Data[YYYYMM]),[Measure 1])
Hope this helps.
- NilRPost Patron
Ashish_Mathur Thanks for answer! It returns 0, what could be the reason?
- Ashish_MathurSuper User
Hi,
The entries the Count columns are probably "numbers stored as text". In the Query Editor, change the data type of that column to Decimal numbers.