Forum Discussion

DebbieE's avatar
DebbieE
Icon for Community Champion rankCommunity Champion
2 years ago

Stacked Column Chart with Legend. Data Labels on appearing as total

Really struggling with some DAX

 

Basically I have a fact table and dimensions. 

In the fact table I have a Person ID (Business Key. It can be repeated in slices of data. for example it can be in multiple times a month. And it will probably be in every months snapshotted dataset. So I have a DISTINCTCOUNT(PersonID) which will give me the total number of people when I slice it.

 

So I have Area in a dimension.

take this example of one  of the areas

This is showed using the Total People Measure above

 

              SnapshotDates

Area    01/01/23       01/02/223    01/03/23       01/04/23     01/05/23       01/06/23  01/07/23  01/08/23   TOTAL

A       210                  215               250                236              261               228           231          258             335    

 

the issue here is that there are 335 unique Person IDs but this is snapshot data so these people can be in every snapshot. So the total isnt adding up to all the values. This is ok here. I can just turn the total off.

 

If I do the average in Excel I get  

235.7777778

However I created this Measure 

 

Average No of Pupils = CALCULATE(
                    AVERAGEX(
                        VALUES('Dim Date '[Snapshot]),DISTINCTCOUNT('Fact'[PersonID])))
And all it does when I use it in a Bar chart is show me the total of Unique Pupil IDs 335
 
So at present I dont know how to show the average because of this data set Im working with. If anyone has an idea. I would be grateful
 

1 Reply

  • I don't think you need the VALUES part.

     

    Please provide sample data that fully covers your issue.
    Please show the expected outcome based on the sample data you provided.