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.
Hi All,
I am a regular reader of this forum, but this is my first time posting a question.
I have a table that lists a count (of users) by month.
I created a measure 'Total Variance' that calculates the difference between a given month and the month before as below:
Total Variance = sum('table'[total_count]) - CALCULATE( sum('table'[total_count]), PREVIOUSMONTH('table'[month].[Date]))The table below, showing a subset of the data, shows that while the difference is calculated correctly it also calculates the difference for June 2019, essentially subtracting the figure for May from the (non-existant) June figure.
Solved! Go to Solution.
Hi @carlj
You may try to add an IF condition in the formula.For example:
Total Variance = IF ( SUM ( 'table'[total_count] ) = BLANK (), BLANK (), SUM ( 'table'[total_count] ) - CALCULATE ( SUM ( 'table'[total_count] ), PREVIOUSMONTH ( 'table'[month].[Date] ) ) )
Regards,
Hi @carlj
You may try to add an IF condition in the formula.For example:
Total Variance = IF ( SUM ( 'table'[total_count] ) = BLANK (), BLANK (), SUM ( 'table'[total_count] ) - CALCULATE ( SUM ( 'table'[total_count] ), PREVIOUSMONTH ( 'table'[month].[Date] ) ) )
Regards,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |