Forum Discussion
Producing a total from a measure - Daily Occupancy
- Anonymous2 years ago
Thanks for the reply from Greg_Deckler , please allow me to provide another insight:
Hi FlankyPank2___ ,Here are the steps you can follow:
1. You might consider joining the relationship between the two tables. when the slicer is selected. which affects Building. based on [Start Date].
2. Create measure.
Measure = var _select=SELECTEDVALUE('Table'[Building]) var _table= SELECTCOLUMNS('Date23-24',"Date",[Date23-24]) var _table2= CROSSJOIN( 'Table',_table) return COUNTX( FILTER( _table2,[Date]>=[Start Date]&&[Date]<=[End Date]&&[Building]=_select),[Name])3. Result:
There is a question as to how the "total is 12" is calculated, because when I add 4+5+4 it is 13.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- 2 years ago
Creating a relationship skewed my chart which plots daily occupancy.
But, the measure seems to work without creating the relationship. I've done some checking and it looks to be accurate but i'm going to check again when it's less Monday Morning!
Thank you so much for your time. (& yes my Math is rubbish, it was 13!) Thanks again
FlankyPank2___ First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8
- FlankyPank2___2 years ago
Helper I
Thanks for your reply.
I'm not sure this is quite what I'm after? I think its how my two tables are able to interact with each other? But I will take time and look into your recommendations and see if it does apply.
Thanks
- Greg_Deckler2 years ago
Community Champion
FlankyPank2___ I think you are correct. I believe you actually need this one:
- FlankyPank2___2 years ago
Helper I
Thank you for this. The answer from v-yan seemed to work but this is also very useful and i'll be trying it out. Thank you