The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
I am currently using a measure to calculate Sales Rate. The calculation is as follows FactTable[X]/FactTable[Y]. The X and Y come from different Fact tables. If Y is not present for the corresponding date, I am getting a value of infinity. It would be good to have nothing show up then to have infinity value. How do I achieve this?
Thanks in advance
Solved! Go to Solution.
Hi,
Thanks for the reply.
I got a solution online before I came across your post. Refer below for the solution.
IFERROR( [Mesaure 1]/[Mesaure 2], BLANK() )
where Mesaure 1 is Sum(FactTable[x])and Mesaure 2 is Sum(FactTable[y])
Found it in this blog- https://sqldusty.com/
Radacad has a very thorough blog about this - best practice etc.
https://radacad.com/make-your-numeric-division-faultless-in-power-query
Found this alternative without getting 'Cannot load Visual Error', DIVIDE function
DIVIDE(numerator,denominator,0)
Reference: https://www.dutchdatadude.com/power-bi-pro-tip-divide-function/
This is a better solution than the one that is posted as the solution. Thank you!
If FactTable[Y] is zero just display blank for example:
Measure = IF(FactTable[Y]=0,BLANK(),FactTable[X]/FactTable[Y])
Hi,
Thanks for the reply.
I got a solution online before I came across your post. Refer below for the solution.
IFERROR( [Mesaure 1]/[Mesaure 2], BLANK() )
where Mesaure 1 is Sum(FactTable[x])and Mesaure 2 is Sum(FactTable[y])
Found it in this blog- https://sqldusty.com/
Thanks, huge help !
IF Error calculation does work, however it takes a load on the memory and fails with 'cannot load visual' error. Is there an alternative to avoid this issue?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
79 | |
72 | |
48 | |
41 |
User | Count |
---|---|
138 | |
108 | |
69 | |
64 | |
57 |