cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Post Patron

## Calculate by Age Range

Hi,

In a sample data model as follows:

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

Etaria (Age Range):

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

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.

Fabio Coatis

1 ACCEPTED SOLUTION
Community Support

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:

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.
4 REPLIES 4
Community Support

HI, @Fcoatis

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

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.
Post Patron

The result esxpected is :

Column12000Column22001Column3

 Etaria .Total .Total Range .Total .Total Range 0-20 76.831 345.447 72.938 344.210 21-30 44.930 345.447 51.143 344.210 31-40 69.492 345.447 52.292 344.210 41-50 30.166 345.447 56.998 344.210 51-60 51.055 345.447 44.336 344.210 61-70 72.973 345.447 66.503 344.210 71-80 345.447 344.210 >80 345.447 344.210 Total 345.447 344.210

Community Support

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:

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.
Post Patron

Thank you very much Lin.

I would never realized that.

Kind Regards,

Fabio

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors