Forum Discussion
How to calculate?
I have a table
I want calculate how many users in interval 25.03.2020 - 30.03.2020 have DateDiff(RefreshDate; ExchangeAct) = 0
Hi,
According to your description, i create a simple sample to test:
Then try this measure:
Measure = IF ( CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Name] IN DISTINCT ( 'Table'[Name] ) && 'Table'[ExchangeAct] <> 'Table'[RefreshDate] ) ) > 0, 1, 0 )The result shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
6 Replies
- az38
Community Champion
Hi Anonymous
try a measure
Measure = CALCULATE(DISTINCTCOUNT(Table[Name]); Table[ExchangeAct] = Table[RefreshDate]; DATESBETWEEN(Table[RefreshDate]; DATE(2020;3;25);DATE(2020;3;30))) - amitchandak
Super User
Create a measure
measure =
calculate(distinctcount(Table[Name]),filter(Table,DateDiff(Table[RefreshDate]; Table[ExchangeAct],day) = 0))
or create a column and measure
column = DateDiff(Table[RefreshDate]; Table[ExchangeAct],day)
measure =
calculate(distinctcount(Table[Name]),Table[Column] = 0)- AnonymousNot applicable
Thanks! But this is not a little not that.
For example
This user have a difference 1 day in 30.03.2020
And this means that it should be excluded. Must get users who have in every day difference = 0
- amitchandak
Super User
You have created a column, That will not suppress row. Create a measure and use in visuals.
- v-gizhi-msft
Community Support
Hi,
According to your description, i create a simple sample to test:
Then try this measure:
Measure = IF ( CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Name] IN DISTINCT ( 'Table'[Name] ) && 'Table'[ExchangeAct] <> 'Table'[RefreshDate] ) ) > 0, 1, 0 )The result shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi