cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fcoatis Member
Member

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

Accepted Solutions
Community Support Team
Community Support Team

Re: Calculate by Age Range

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
Community Support Team
Community Support Team

Re: Calculate by Age Range

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.
Fcoatis Member
Member

Re: Calculate by Age Range

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

Community Support Team
Community Support Team

Re: Calculate by Age Range

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

Highlighted
Fcoatis Member
Member

Re: Calculate by Age Range

Thank you very much Lin.

 

I would never realized that.

 

Kind Regards,

 

Fabio

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 352 members 3,180 guests