Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Fcoatis
Post Patron
Post Patron

Calculate by Age Range

Hi,

 

In a sample data model as follows:

 

Fig 0.PNG

 

My fact table Venda (Sales) has 3 calculated columns :

 

Idade (Age)

 

Fig 1.PNG

 

Etaria (Age Range):

 

Fig 2.PNG

 

and Pos ( just for sort purposes). Im trying to calculate a matrix like this one:

 

Fig 4.PNG

 

But the measure (.Total Range) is not ignoring the Age Range filter. What am I doing wrong? All Ranges for each year , should be the Total for that year.

 

Fig 3.PNG

 

Thanks in advance.

 

Fabio Coatis

 

 

 

1 ACCEPTED SOLUTION

hi, @Fcoatis

After my test, this is due to Sort by Function, so you could use this formula:

.Total Range = CALCULATE([.Total],all(Venda[Etaria],Venda[Pos]))

Result:

3.PNG

 

Best Regards,

Lin

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

HI, @Fcoatis

I have tested on my side, but not reproduce the issue. If possible, please share detail steps for us.

please share your sample pbix file and expected output. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.

 

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for your reply.

 

Here is the link:

 

https://drive.google.com/drive/folders/1R45lnyJbHMW8SNPtzrVuSRBjfCPiPowX?usp=sharing

 

The result esxpected is :

 

Column12000Column22001Column3

Etaria.Total.Total Range.Total.Total Range
0-2076.831345.44772.938344.210
21-3044.930345.44751.143344.210
31-4069.492345.44752.292344.210
41-5030.166345.44756.998344.210
51-6051.055345.44744.336344.210
61-7072.973345.44766.503344.210
71-80 345.447 344.210
>80 345.447 344.210
Total345.447 344.210 

 

Thanks in advance

hi, @Fcoatis

After my test, this is due to Sort by Function, so you could use this formula:

.Total Range = CALCULATE([.Total],all(Venda[Etaria],Venda[Pos]))

Result:

3.PNG

 

Best Regards,

Lin

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much Lin.

 

I would never realized that.

 

Kind Regards,

 

Fabio

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!