lowstrife
lowstrife

Reputation: 1

use data slicer to distinct count in DAX PowerBI Desktop

I have two columns Month and ID a want distinc count per each month, but once I use data slicer to show data it shows as count distinct per select period

For example I have

I have

I used : COUNT_ID = distinctcount('ID'[DATA])

once I select in data slicer 202207 & 202208 I get distinct values 4:

WANT

but I want result 5 because

202207 distinct values 2 202208 distinct values 3

I want to use this logic for whole data set once I select specific period. Has anybody can help with?

Upvotes: 0

Views: 417

Answers (1)

Marcus
Marcus

Reputation: 4005

Ids =
SUMX (
    VALUES ( 'Table'[Month] ),
    CALCULATE ( DISTINCTCOUNT ( 'Table'[ID] ) )
)

Upvotes: 0

Related Questions