Forum Discussion
DAX Result
I have attach a screenshot of my table view :http://prntscr.com/jx6ow8
I have created a measure :
Measure 6 = CALCULATE(COUNT(TblStudent[StId]),TblStudent[StStatus]="Active"), which give count of active student,
I have created another measure:
StudentCount=IF(CALCULATE(COUNT(TblStudent[StId]),TblStudent[StStatus]="Active")>20,20,CALCULATE(COUNT(TblStudent[StId]),TblStudent[StStatus]="Active"))
It return 20 if count of student is greater than 20 in table view else same value, But the total at bottom in table show 20 for StudentCount, please guide how can I correct it?
Thanks in advance...
3 Replies
- jthomsonSolution Sage
Seems like a classic case that https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/m-p/63376#U63376 will solve
- mohit19Frequent Visitor
It does not solve my problem, can you please provide dax expression for that.
- AnonymousNot applicable
HI mohit19,
You can try this, I add condition to skip replace formula calculate on total level:
StudentCount = IF ( CALCULATE ( COUNT ( TblStudent[StId] ), TblStudent[StStatus] = "Active" ) > 20 && ISFILTERED ( TblStudent[StId] ), 20, CALCULATE ( COUNT ( TblStudent[StId] ), TblStudent[StStatus] = "Active" ) )Regards,
Xiaoxin Sheng