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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
anandsoftweb
Advocate V
Advocate V

Min value count data in DAX

Hello,

 

I want dax calculation for min status value from specific Item Segment

 

below is my sample data.

 

 

IdItemSub ItemItem StatusDescription for Count the ValueExpected Result/OP In DAX As below 
1Item11100For Item 1 Min Status is 0Total Count of Status 0 = 2
1Item11111  
1Item21120For Item 2 Min Status is 0 
1Item21131  
1Item21142  
1Item31151For Item 3 Min Status is 1Total Count of Status 1 =2
1Item31162  
1Item31173  
1Item41181For Item 3 Min Status is 1 
1Item41192  
1Item51202For Item 5 Min Status is 2Total Count of Status 2 =1
1Item51213  

 

So final Out put should be in count and I would like to display in Bar Chart By Status Count like

 

Eg,

Status 0 :- 10 Count,

Status 1 :- 20 Count, 

Status 2 :- 15 Count, 

Status 3 :- 20 Count

 

From above table

 

Thanks In Advance 

 

1 ACCEPTED SOLUTION

@anandsoftweb

I really think these should work! Smiley Happy

 

NEW Measure (Min Status) = 
CALCULATE ( MIN ( 'NewTable'[Item Status] ), ALLEXCEPT ( 'NewTable', 'NewTable'[Item], 'NewTable'[Id] ) )

NEW Measure (Count of Status) = CALCULATE ( COUNTA ( 'NewTable'[Item Status] ), FILTER ( 'NewTable', 'NewTable'[Item Status] = [NEW Measure (Min Status)] ), ALLEXCEPT ( 'NewTable', 'NewTable'[Item], NewTable[Id] ) )

 

Good Luck!Smiley Happy

View solution in original post

3 REPLIES 3
Sean
Community Champion
Community Champion

@anandsoftweb

These 2 Measures work with the sample data

 

Measure (Min Status) = 
CALCULATE ( MIN ( 'Table'[Item Status] ), ALLEXCEPT ( 'Table', 'Table'[Item] ) )

Measure (Count of Status) = 
CALCULATE (
    COUNTA ( 'Table'[Item Status] ),
    FILTER ( 'Table', 'Table'[Item Status] = [Measure (Min Status)] ),
    ALLEXCEPT ( 'Table', 'Table'[Id] )
)

And the results...

 

Min Status and Count of Status.png

Hope this helps!

Good Luck! Smiley Happy

 

@Sean ,

 

Thanks for your quick reply and DAX calculation its near up to the solution, its really helpful but for multiple id and total count is not matched.

 

Here ID should be 2,3,4.... like wise and total (Measure (Count of Status )) should be match with total Item count like as below

 

Item 1 has Item Status 0 as a Min

Item 2 has Item Status 1 as a Min

Item 3 has Item Status 2 as a Min

Item 4 has Item Status 0 as a Min 

Item 5 has Item Status 1 as a min

 

So

total 5 items and I

Item Status 0 = 2

Item Status 1 = 2

Item Status 2 = 1

 

So total should be 5 at the end

 

In sample data it works ut in case of multiple ID its not working. while selecting id

 

I think there should be minor change in calculation so here you can help out.

 

If possible pls help here 

 

Thanks once again 🙂

 

Note:-1 It should be distinct count  

 

@anandsoftweb

I really think these should work! Smiley Happy

 

NEW Measure (Min Status) = 
CALCULATE ( MIN ( 'NewTable'[Item Status] ), ALLEXCEPT ( 'NewTable', 'NewTable'[Item], 'NewTable'[Id] ) )

NEW Measure (Count of Status) = CALCULATE ( COUNTA ( 'NewTable'[Item Status] ), FILTER ( 'NewTable', 'NewTable'[Item Status] = [NEW Measure (Min Status)] ), ALLEXCEPT ( 'NewTable', 'NewTable'[Item], NewTable[Id] ) )

 

Good Luck!Smiley Happy

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Users online (844)