Forum Discussion
AnandRanga
9 years agoHelper III
Where to write count in this expression ?
this is my sql query:
select count(Temperature) as TempUP, max([Date]) from Second_18FE34D47A8F$ where Temperature>25
group by [Date]
order by [Date]
same expression I want to write in DAX, till now I am done this:
EVALUATE
SUMMARIZE (
CALCULATETABLE (
Second_18FE34D47A8F,
FILTER ( Second_18FE34D47A8F, Second_18FE34D47A8F[Temperature] > 25 )
),
Second_18FE34D47A8F[Temperature],
Second_18FE34D47A8F[Date]
)
It produces this result, In DAX studio.(a few rows of result set)
| Temperature | Date | |
| 33.2 | 09/11/2016 | |
| 33.5 | 09/11/2016 | |
| 33.6 | 09/11/2016 | |
| 32.1 | 09/11/2016 | |
| 32.5 | 09/11/2016 | |
| 32.4 | 09/11/2016 | |
33 |
|
I need only one count for one date, where to put count and order by in it?
Thanks for help.
Hi, AnandRanga
Please try the formula below:
New Table = SUMMARIZE(
CALCULATETABLE (
Second_18FE34D47A8F,
FILTER ( Second_18FE34D47A8F, Second_18FE34D47A8F[Temperature] > 25 ) ),
Second_18FE34D47A8F[Date],
"Count",
COUNT(Second_18FE34D47A8F[Temperature])
)Thanks,
Yuliana Gu
1 Reply
- v-yulgu-msftMicrosoft Employee
Hi, AnandRanga
Please try the formula below:
New Table = SUMMARIZE(
CALCULATETABLE (
Second_18FE34D47A8F,
FILTER ( Second_18FE34D47A8F, Second_18FE34D47A8F[Temperature] > 25 ) ),
Second_18FE34D47A8F[Date],
"Count",
COUNT(Second_18FE34D47A8F[Temperature])
)Thanks,
Yuliana Gu