The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi community,
Hoping you can assist, i am trying to Sum my count and show the total in a new column for every row.
See below:
Total Occupany is a measure counting the records based on my slicer selection. I
I am trying to sum the count values into a new column and show the value in every row.
Thanks in Advance
Solved! Go to Solution.
Can you try like below
CountRows AllSelected = CALCULATE ( [CountRoomOccWGroup], ALLSELECTED ( 'Room' ) )
Even if your measure [CountRoomOccWGroup], look strange for me, i don't understand why you need to apply allexcept in that way.
By taking a similar model to yours, i have the expected result
find the pbix here
hi @ced_f
thanks for getting back.. I tried the code but does not seem to produce the right result still.
Also tried the same with KEEPFILTERS
Seem the Sum calculation ignores the selected values in the slicer and counts all the records in the table
If you have some others filters that need to be keep, in that case you can use ALLSELECTED function (to use with precaution as it's pretty complex as function).
Without more details in your model, it's little hard to tell you how to use it properly.
One way which can work is.
CALCULATE (SUM(factRoomOccupancy[CountRoomOccWGroup]), ALLSELECTED(factRoomOccupancy[CA_Name]))
Here the idea is to get the total for "All" available "CA_Name" values in the context.
Regards
Hi @ced,
Still was not able to get it to work.
This is how i am calculating the roomoccupancycount:
Which is used in the SumRowCount calc
Below is what the model looks like, i not able to attache a file else i would have.
But it is quite simple model
Can you try like below
CountRows AllSelected = CALCULATE ( [CountRoomOccWGroup], ALLSELECTED ( 'Room' ) )
Even if your measure [CountRoomOccWGroup], look strange for me, i don't understand why you need to apply allexcept in that way.
By taking a similar model to yours, i have the expected result
find the pbix here
You can use a piece of code like :
CALCULATE (SUM(Table[Total Occupancy]), REMOVEFILTERS(Table))
Regards
Cedric
User | Count |
---|---|
69 | |
68 | |
64 | |
54 | |
28 |
User | Count |
---|---|
112 | |
81 | |
65 | |
48 | |
43 |