cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors