Forum Discussion
SQL to DAX conversion
- 8 years ago
Try this New Table from Modelling Tab
New Table = SUMMARIZE ( C, C[Start Time], C[End Time], "Count", CALCULATE ( COUNT ( D[Operating value] ), FILTER ( D, D[Operating value] <= 5 && D[Process Time] >= C[Start Time] && D[Process Time] <= C[End Time] ) ) ) - 8 years ago
Another way
New Table2 = CALCULATETABLE ( SUMMARIZE ( C, C[Start Time], C[End Time], "Count", CALCULATE ( COUNT ( D[Operating value] ), FILTER ( D, D[Process Time] >= C[Start Time] && D[Process Time] <= C[End Time] ) ) ), D[Operating value] <= 5 )
Table have 20 rows and my table visualization display data only when Gap>=3(as given below) which i able to display on dashboard. Along with table visualization i wanted to display count of attendee who has Gap>=3 on Card visualization(Value should be 6) which i am unable to do.
Any help or idea is much appreciated.
| Attendee Name | Meetings | Gap |
| Claire Baker | 1 | 4 |
| Geneva Barnett | 1 | 4 |
| Johnnie Carpenter | 1 | 4 |
| Jonathan Goodwin | 1 | 4 |
| Marsha Robertson | 1 | 4 |
| Salvador Elliott | 1 | 4 |
Hi nish2288,
Create a following measure using DAX:
Count Of Attendee Gap gt 3 = CALCULATE(COUNT(TableName[Attendee Name]),TableName[Gap]>3)
After creating measure pull this measure on Card Visual. You will get your solution.
Regards,
Mayur
- nish22888 years agoHelper I
Getting following error:
A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression.This is not allowed.
- mwadhwani8 years agoKudo Kingpin
- nish22888 years agoHelper I
There is a twist. Gap is not a column in the table,its a measure that i have created.
Suppose Attendee name 'John' have attended 3 meeting then there will be 3 rows in database table for 'John'.
There is predefined value which define how many meetings everyone should attend for ex. 5.
So for 'John' gap would be 2.
Like wise for other attendee.
- nish22888 years agoHelper I
There is a twist.Gap is not a column in the table,Its a measure that i have calculated.
Suppose attendee 'John' have attended 3 meeting then there will be 3 rows in database table for 'john'.
There is predefined number of meeting that every attendee should attend for ex. 5 which i stored in different measure.
So Gap for John will be 5-3=2. Like wise for other attendee.