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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
laurocarmo
Regular Visitor

Calculated columns based on filters

Dear all,

I hope this post find you all health and safe!

 

I am new on Power BI, but I use Excel for many years.
I am "converting" my Excel analysis to Power BI Desktop, but I found a dificulty now.

There are 3 columns (links quantity, faults quantity and total fault duration) and I need to calculate the average of faults / links and duration / links.

I was able to execute this on Excel, but o DAX not, because these two calculated columns do not change the values when I use fields filters.

 

This is the "normal" situation, without filters

laurocarmo_0-1713968383947.png

 

And this is the situation using filter (on year selection)

laurocarmo_1-1713968531600.png

 

See the columns faults quantity and total duration time were updated, but the average columns not.

 

Sorry if this doubt was already solved, but I didn't find it.

 

Thanks in advance and best regards!

5 REPLIES 5
laurocarmo
Regular Visitor

Hi @ray_aramburo,

In fact, I was not able to create a formula / measure for this, because it retrieved only one answer.
One test I did is:

Medida = CALCULATE(SUM('Cálculo Ranking'[Qtde Serviços]);FILTER('Cálculo Ranking';'Cálculo Ranking'[Provedor]="ACESSOLINE TELECOMUNICACOES LTDA"))

but the result is not dinamic, but related only to one provider.
 
Other attempt was:
 
Coluna = 'Cálculo Ranking'[Qtde Falhas]/'Cálculo Ranking'[Qtde Serviços] IN SELECTEDVALUE(Table1[Ano];2020)

and this:
 
Coluna = AVERAGEX('Cálculo Ranking';('Cálculo Ranking'[Qtde Falhas]/'Cálculo Ranking'[Qtde Serviços]))

Hi, @laurocarmo 

Thanks for @ray_aramburo reply. Would love to help, but you need to share out the logic that achieves the results you want and the pbix file without sensitive data for testing purposes.

Best Regards,
Yang
Community Support Team

Thanks @ray_aramburo and @v-yaningy-msft for the support,

Sorry for my absence of knowledge, but could you tell me how to share these files?
I've tried to attach them here, but I was not possible...

 

Hi, @laurocarmo 

You can use Google Drive to share your pbix files as a link (you need to set it up to be accessible without an account login).

Best Regards,
Yang
Community Support Team

ray_aramburo
Super User
Super User

How are you calculating in Power BI Average Faults/Links and Duration/Links?





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.