Forum Discussion
Infinity error
- 6 years ago
Hi,
According to your description, i create three tables to test:
Please take following steps:
1)Create a measure:
Measure = DIVIDE(COUNTROWS(Registrations),SUM(Regions[Population]))Choose a matrix visual and it shows:
2)Create another measure:
Measure 2 = VAR d = SELECTEDVALUE ( 'Year-Month'[Year-Month] ) RETURN IF ( COUNTROWS ( 'Registrations' ) = 0, VAR t = FILTER ( SUMMARIZE ( FILTER ( ALLSELECTED ( 'Year-Month' ), 'Year-Month'[Year-Month] < d ), 'Year-Month'[Year-Month].[Year], 'Year-Month'[Year-Month].[MonthNo], "Number", CALCULATE ( COUNTROWS ( 'Registrations' ) ) ), [Number] > 0 ) RETURN CALCULATE ( [Measure], FILTER ( ALLSELECTED ( 'Registrations' ), 'Registrations'[Region] IN FILTERS ( 'Registrations'[Region] ) && MONTH ( 'Registrations'[Year-Month] ) = MAXX ( t, [Year-Month].[MonthNo] ) && YEAR ( 'Registrations'[Year-Month] ) = MAXX ( t, [Year-Month].[Year] ) ) ), [Measure] )And it replace the original blank with previous month's data, the result shows:
Here is my test pbix file:
Best Regards,
Giotto ZHi
Hi rajulshah amitchandak thank you for your replies but this creates a different problem as now the Infinities are showing as blanks. As I mentioned this is a cumulative formula so it does not make sense to have blanks. If no registrations happened in a month, it needs to show the exact same value as the previous month. Please let me know how I can fix the error?
Hello Anonymous,
Maybe the following link can help you:
https://community.powerbi.com/t5/Desktop/Filling-the-blanks-of-a-running-total-with-last-non-blank-value/td-p/169041
- Anonymous6 years agoNot applicable
Hi rajulshah thank you but my formula is working fine with just the numerator, it's when I try and divide this cumulative sum by a denominator that the Infinities/blank cells appear. The error only appears when there are no new registrations in a month.
Does anyone have any further ideas? amitchandak
- amitchandak6 years ago
Super User
Your are viewing data by Year and denomintor is coming another table. How it is becoming 0. Can you share some sample data.