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.
Hello
Please can you help me with this .. I have tried many different things but as a new PBI user I am struggling with this:
I need to calculate the variance/difference for a measure from last month (in this case Sept 19) versus same time last year (in this case = Sept 18) I can do this using filters but as you will see in the file attached to this link,
https://drive.google.com/open?id=1BBtjX2jgsSTA76xgsUM7sn2yFLV4fWmT
that I have a measure showing 50 for last month this year being Sept and the measure for the same month last year showing 30.
I need to show in a card the value 20 as this would be the month this year vs month last year variance. However I would need to build this into a calc as it would have to be dynamic. ie .. next month you would see Oct 19 vs Oct 18.
Thanks so much,
Marc
Solved! Go to Solution.
Hi @MarcUrdang
I create a simple test file as below:
Create measures
today = TODAY() last_m_thisyear = CALCULATE ( SUM ( Sheet10[value] ), FILTER ( Sheet10, Sheet10[date] >= DATE ( YEAR ( [today] ), MONTH ( [today] ) - 1, 1 ) && Sheet10[date] < DATE ( YEAR ( [today] ), MONTH ( [today] ), 1 ) ) ) last year = CALCULATE ( SUM ( Sheet10[value] ), FILTER ( Sheet10, Sheet10[date] >= DATE ( YEAR ( [today] ) - 1, MONTH ( [today] ) - 1, 1 ) && Sheet10[date] < DATE ( YEAR ( [today] ) - 1, MONTH ( [today] ), 1 ) ) ) diff = [last_m_thisyear]-[last year]
If today is 2019/11/2
Hi @MarcUrdang
I create a simple test file as below:
Create measures
today = TODAY() last_m_thisyear = CALCULATE ( SUM ( Sheet10[value] ), FILTER ( Sheet10, Sheet10[date] >= DATE ( YEAR ( [today] ), MONTH ( [today] ) - 1, 1 ) && Sheet10[date] < DATE ( YEAR ( [today] ), MONTH ( [today] ), 1 ) ) ) last year = CALCULATE ( SUM ( Sheet10[value] ), FILTER ( Sheet10, Sheet10[date] >= DATE ( YEAR ( [today] ) - 1, MONTH ( [today] ) - 1, 1 ) && Sheet10[date] < DATE ( YEAR ( [today] ) - 1, MONTH ( [today] ), 1 ) ) ) diff = [last_m_thisyear]-[last year]
If today is 2019/11/2
Hi Maggie
AMAZING AMAZING AMAZING
It works perfectly
THANK SO MUCH
regards,
Marc
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 |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |