Forum Discussion
Sumx is not working with iterative condition
Hi,
Problem statement trying to address : I have a dataset that have people and ther age. I am trying to count the number of people based on the dynamic bin(X axis) that i have created using numeric range filter from 0 - 120 . But for some reason my measure (SumX )is not working, it is just putting all the counts into one single bucket. Please see the screenshot and measure below, Can someone please assist. Thanks!
Expected result is to show 1 in each 60 and 70 row's, but it is showing in in single bucket i.e. 60.
Thanks
**************************************
- Anonymous3 years ago
Hi BChinya ,
Please try:Number of subjects within = VAR _Binsize_min = SELECTEDVALUE ( 'Bin Start'[Bin Start] ) VAR _binsize_end = _Binsize_min + SELECTEDVALUE ( 'Bin Size'[Bin Size] ) VAR _subnr = CALCULATE ( COUNTROWS ( DM ), 'DM'[Age] >= _Binsize_min && 'DM'[Age] < _binsize_end, ALLSELECTED ( 'DM'[Subject] ) ) RETURN _subnrOutput:
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
3 Replies
- Ritaf1983
Super User
Hi BChinya
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - AnonymousNot applicable
Hi BChinya ,
Please try:Number of subjects within = VAR _Binsize_min = SELECTEDVALUE ( 'Bin Start'[Bin Start] ) VAR _binsize_end = _Binsize_min + SELECTEDVALUE ( 'Bin Size'[Bin Size] ) VAR _subnr = CALCULATE ( COUNTROWS ( DM ), 'DM'[Age] >= _Binsize_min && 'DM'[Age] < _binsize_end, ALLSELECTED ( 'DM'[Subject] ) ) RETURN _subnrOutput:
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
- BChinyaFrequent Visitor
Thank you. This works like charm!