Forum Discussion
Need Urgent help
Hi, I want to create a histogram in power BI which will show count of user ids per their Sum of total revenue.
The thing is that I have to group the revenue like: 0-50 GBP, 51-100 GBP,101-150 GBP till 500.
I have to show count of user ids per every group . Please see the attached screenshot.
I am unable to do that as it will vary after selecting values in different slicers like Market, Country, Month etc.
I can show sum of revenue but for the group I have to create a meaasure which I did but unable to add gthat measrue in y axis.
Please help me.
Hi Anonymous
please refer to the linked video:
https://www.youtube.com/watch?v=FDa0I3J3h-cIf this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Anonymous
if this is what you want :
then just modify the code to this :
Measure 9 = var lowerbound = MIN(Segment_table[Min]) var upperbound = MAX(Segment_table[max]) var ds = FILTER( VALUES(Sheet1[UUID]), [Total Revenue] >= lowerbound && [Total Revenue]< upperbound ) return COUNTROWS(ds)let me know if this works.
If my answer helped sort things out for you, i would appreciate a thumbs up π and mark it as the solution β
It makes a difference and might help someone else too. Thanks for spreading the good vibes! π€
12 Replies
- Ritaf1983Super User
Hi Anonymous
please refer to the linked video:
https://www.youtube.com/watch?v=FDa0I3J3h-cIf this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- AnonymousNot applicable
Please review the attached 2 screenshots
One screenshot is from my power BI file and second screenshot is from the video which is showing the dax.
. If I select UUID(user id) then in the bar chart it is showing 3 different bars . As the total Revenue is 433.98(see table view), the bar of bar chart should only show 1 bar which comes under 400 - 450 GBP.
All other slicers are showing the correcct value.
This UUID slicer is not required but if I do deep analysis then I am facing this concern
I am stuck here. I already made the calculation but with a diffrent way. In the video they have shown me a shortcut.
This is the dax that I have written after watching the video:
Group Revenue =CALCULATE(COUNTROWS(act_orders),FILTER(act_orders,NOT(ISEMPTY(FILTER(Segment,NOT(ISBLANK([Total Revenue])) && Segment[Min]<[Total Revenue] && Segment[Max]>=[Total Revenue])))))In the video they are not facing this multiple bars concern but I am facing.I beg you pls help me.- Ritaf1983Super User
Hi Anonymous
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
- Daniel29195Community Champion
Anonymous
sample data used in my example :
output :
table names : dataa , groups
steps :
create table groups as follow :
now create the following measure :
Measure 9 = var lowerbound = MIN(groups[lower]) var upperbound = MAX(groups[upper]) var ds = FILTER( dataa, CALCULATE(sum(dataa[revenue])) >= lowerbound && CALCULATE(SUM(dataa[revenue])< upperbound) ) return COUNTROWS(ds)let me know if this helps.
If my answer helped sort things out for you, i would appreciate a thumbs up π and mark it as the solution β
It makes a difference and might help someone else too. Thanks for spreading the good vibes! π€- AnonymousNot applicable
Daniel29195 . No its not working. I am uploading the sample data. Please check mine
- AnonymousNot applicable
omgggggggggg. Its working . Many thanks
I was trying to fix this since a month but you solved it in half an hour.
May I know from where I can learn to use dax functions in advanced level. Like in my scenario you have fixed it quickly ?