Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
How to write the formula Power bi in DAX
Sum(Case When (columnname) < 10 Then 1 Else 0 End) Over (Partition By ColumnName)
Solved! Go to Solution.
Hi there,
So the EARLIER function is grouping by values in a specified column, so those column names need to be the same, in the example below you're using ColumnName1 against ColumnName, those should match and then the query should work.
@kalavala wrote:
How to write the formula Power bi in DAX
Sum(Case When (columnname) < 10 Then 1 Else 0 End) Over (Partition By ColumnName)
Besides @Reid_Havens's solution, or a more intuitive approach.
Measure = SUMX ( Table1, SWITCH ( TRUE (), Table1[Column1] < 10, 1, 0 ) )
Hi there,
Happy to help!
So it looks like you're wanting a count of rows when [ColumnName] is less than 10 correct? It also seems you're using the OVER partition to group by the [ColumnName] values for the count? If that is the case then a DAX Measure could look like:
=
CALCULATE (
COUNTA ( [ColumnName] ),
[ColumnName] < 10,
FILTER ( TableName, [ColumnName] = EARLIER ( [ColumnName] ) )
)
Hope this helps!
Reid Havens - Owner
Hello Havens,
the below calcuation part columnname 1
DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.
please help me
=
CALCULATE (
COUNTA ( [ColumnName] ),
[ColumnName] < 10,
FILTER ( TableName, [ColumnName1] = EARLIER ( [ColumnName] ) )
)
Hi there,
So the EARLIER function is grouping by values in a specified column, so those column names need to be the same, in the example below you're using ColumnName1 against ColumnName, those should match and then the query should work.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 26 | |
| 24 | |
| 23 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 30 | |
| 28 | |
| 21 | |
| 19 | |
| 17 |