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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Jordanokstate
Frequent Visitor

infinity filtering help

Hello, 

 

I've calculated the average for dates not within the last 30 days.

 

However, I want to apply this average to each line item in the last 30 days on another visual as a static number.

 

It however, it giving me infinity instead, which is should because of filtering context. Is there anyway to return a dax measure as 1 number and ignore filters applied before saving it?

 

For example, calculating the average growth rate of cats saving that growth rate,, but putting that same growth rate in a table with rows where animal ="dogs"?

1 ACCEPTED SOLUTION

Hi @Jordanokstate 

 

If you're satisfied that your original measure is correct (i.e. 10.84%), and all you are trying to do is remove the blanks, I'd recommend doing this:

TheoC_1-1633497724508.png

 

By doing the above, your output will be as follows:

 

TheoC_0-1633497675114.png

 

Although I did look at the PBIX, with my limited level of acumen, it's hard to determine all of the measures and their calculations versus what you are trying to achieve with each.

 

Hope the above helps mate.

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

11 REPLIES 11
Jordanokstate
Frequent Visitor

I tried the following: Predicted_30d_Buy_from3d = CALCULATE(([3day Conversion]/[3/30 Flow Rate Avg]+0),ALL(Buys),FILTER(ALL('Date'),'Date'[Date]<[Max_Date]-100)) 

 

to attempt to get rid of the dates that I dont want. However, they still appear within the visual.

@Jordanokstate, I'd recommend either breaking up the measure into multiple measures or use variables, just to help with the clarity.  For example, using measures:

 

1. Measure n1 = [3day Conversion] / [3/30 Flow Rate Avg] + 0

2. Measure n2 = CALCULATE ( {Measure n1] , 'Date'[Date] > Date ( 2021, 9 , 4 ) , ALL ( 'Date' ) )

 

Let me know how the above goes. Worst case scenario, you can always just click on your visual (i.e. table) and go to the Filters on This Visual. Once you're there, go to Inquiries field, click on Fitler Type = Advanced Filtering and "is not blank" then hit apply. That will remove the blank rows. 

TheoC_1-1633489561971.png

 

Also, just out of curiousty, the two columns in your table, are they correct?

TheoC_0-1633489363646.png

Let me know how it goes 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Jordanokstate
Frequent Visitor

pic1.jpg

@Jordanokstate, one way to achieve it is by adding "FILTER" to the "ALL" function.  For example: 

Measure with Date Filter =
     CALCULATE ( [Measure] ,
          FILTER ( ALL ( Table ) , Table [Date] > DATE ( 2021 , 9 , 4 ) )
                       ) 
 
Hope this helps mate!

Mate, modified the measure based on seeing your screenshot.  Did not think to ask about the 9/5/2021 lol.  The DATE value should be DATE ( 2021 , 9 , 4 ) to return anything greater than 4 September 2021.

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

TheoC
Super User
Super User

Hi @Jordanokstate 

 

I may not entirely understand what you are asking, so my apologies!  However, what you may be looking for is something to ignore filters.  If you have one table, then use measure one. If you are cross analysing two tables, use measure two.

 

  1. One Table Filter = CALCULATE ( [MEASURE] , ALL ( Table1 ) )
  2. Two Table Filter = CALCULATE ( [MEASURE] , ALL ( Table1 ) , ALL (Table2) )

Let me know if this helps 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

This works to get the values into the table as shown below, but I still do not want the table to show any rows,prior to 9/5/2021. It currently shows it even though there is a filter on the visual becaose of the ALL on the measure. How would I get rid of those dates again?

 

 

 

@Jordanokstate, one way to achieve it is by adding "FILTER" to the "ALL" function.  For example: 

Measure with Date Filter =
     CALCULATE ( [Measure] ,
          FILTER ( ALL ( Table ) , Table [Date] > DATE ( 2021 , 9 , 4 ) )
                       ) 
 
Hope this helps mate! 🙂
 
Mate, modified the measure based on seeing your screenshot.  Did not think to ask about the 9/5/2021 lol.  The DATE value should be DATE ( 2021 , 9 , 4 ) to return anything greater than 4 September 2021.

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Maybe I'm doing something wrong. Here is the screenshot, it now returns 0% which isn't what I am looking for. Below you can find the the power bi file, specifically I am looking at the predicted_30d_buy_from 3d measure.pic 2.PNG

 

https://1drv.ms/u/s!Ag08lU4J4vcXsnwAIgpVzyIUfxum?e=VLayPJ

Hi @Jordanokstate 

 

If you're satisfied that your original measure is correct (i.e. 10.84%), and all you are trying to do is remove the blanks, I'd recommend doing this:

TheoC_1-1633497724508.png

 

By doing the above, your output will be as follows:

 

TheoC_0-1633497675114.png

 

Although I did look at the PBIX, with my limited level of acumen, it's hard to determine all of the measures and their calculations versus what you are trying to achieve with each.

 

Hope the above helps mate.

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

OFMG THERE ARE NO WORDS TO EXPRESS HOW MUCH I APPRECIATE YOU. Midterms coming up with this expected to be due in 24 hours for work with the last couple nights I've been haiving little to no sleep -- thank you. If I can send you a 10 dollar target giftcard -- 

Haha - @Jordanokstate do not be silly big fella! No need for a gift card or anything like that at all! I just wish I could have given you what you were looking for sooner lol!

 

Best of luck with it all mate! You've put together a massive amount of effort in the file. Best of luck with it all (and make sure to remove the sharing of the PBIX otherwise someone else down the track will try take it for their assignment haha).

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.