Forum Discussion
Year to go Measure
- 5 years ago
Hi TaroGulati ,
Try like below :
step1, create silcer table :
Table2 = DISTINCT('Table'[YYYYMM])MON = RIGHT(Table2[YYYYMM],2)year = LEFT(Table2[YYYYMM],4)Step 2,create month and year column on base table:
Month = FORMAT('Table'[Date],"MM")Year = FORMAT('Table'[Date],"YYYY")Then use the below measure :
NUMBER = VAR MON = CALCULATE ( MAX ( 'Table2'[MON] ), FILTER ( ( 'Table2' ), MAX ( 'Table'[Month] ) > SELECTEDVALUE ( Table2[MON] ) ) ) VAR YEAR = CALCULATE ( MAX ( 'Table2'[year] ), FILTER ( ( 'Table2' ), MAX ( 'Table'[Year] ) = SELECTEDVALUE ( Table2[year] ) ) ) RETURN IF ( MON <> BLANK () && YEAR <> BLANK (), MAX ( 'Table'[Numbers] ), BLANK () )Get the below:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien
add 1 to the MONTH code like below to get Feb rather than Jan:
month(DATEVALUE("2020/"&_M&"/01"))+1
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos✌️!!
Hi,
i did add one month in below measure:
now below mentioned measure is not giving me any result
any idea where is still the issue?
Thanks
- VahidDM5 years ago
Super User
Hi TaroGulati
Can you share your file here [after removing sensitive data]? And share a sample of your data in a table format here? And also, let me know the [total numbers] codes?
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos !!
- TaroGulati5 years ago
Helper III
Hi,
https://1drv.ms/x/s!AoMB6moPXeKTd9ZQHQ8-nsHGCFs?e=9TPCeZ
this is the link for the file that i am using.
measure for total number is this:
total numbers = SUM(Sheet1[Numbers])Thanks