Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Count column per category on basis of values from measure

Hello, 

I have a dummy table as below:01Abhi_0-1678355957458.png

Diff value is not a column but a calculated measure.

What I need is a table as below:

01Abhi_1-1678356077374.png

So on basis of measure  "Diff value", I want to calculate count of elements that have value >5.

I am trying to work with below DAX:

Count = SUMMARIZE(table ,table[ElementName],"Count DiffValue>5",
'Measure'[Diff Value]).
The above code is not working and it gives error as below:
01Abhi_2-1678357426745.png

 

Is there another method to group by on basis of values from a measure?

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Count Diff Value > 5 =
VAR SummaryTable =
    ADDCOLUMNS (
        SUMMARIZE ( 'Table', 'Table'[Element], 'Table'[Coordinates] ),
        "@diff value", [Diff value]
    )
VAR Result =
    COUNTROWS ( FILTER ( SummaryTable, [@diff value] > 5 ) )
RETURN
    Result

View solution in original post

2 REPLIES 2
Ahmedx
Super User
Super User

Screen Capture #463.pngScreen Capture #462.png

johnt75
Super User
Super User

Try

Count Diff Value > 5 =
VAR SummaryTable =
    ADDCOLUMNS (
        SUMMARIZE ( 'Table', 'Table'[Element], 'Table'[Coordinates] ),
        "@diff value", [Diff value]
    )
VAR Result =
    COUNTROWS ( FILTER ( SummaryTable, [@diff value] > 5 ) )
RETURN
    Result

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.