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,
Im trying to get the delta between latest rig count and previous count (MoM change). My data has several dates (Publish Date) to get the right rig count number I need to use only the latest date of each month.
To get the latest date Im using this measure:
Solved! Go to Solution.
Hi @Anonymous ,
You can try to use following measure formula, I add a variable to get previous month max data based on current country group:
Previous Count = VAR currDate = MAX ( 'impt BakerHughesNam'[PublishDate] ) VAR prevDate = CALCULATE ( MAX ( 'impt BakerHughesNam'[PublishDate] ), FILTER ( ALLSELECTED ( 'impt BakerHughesNam' ), [PublishDate] < currDate && FORMAT ( [PublishDate], "mm/yyyy" ) = FORMAT ( DATE ( YEAR ( currDate ), MONTH ( currDate ) - 1, 1 ), "mm/yyyy" ) ), VALUES ( 'impt BakerHughesNam'[Country] ), VALUES ( 'impt BakerHughesNam'[County] ) ) RETURN CALCULATE ( SUM ( 'impt BakerHughesNam'[RigCount] ), FILTER ( ALLSELECTED ( 'impt BakerHughesNam' ), [PublishDate] = prevDate ), VALUES ( 'impt BakerHughesNam'[Country] ), VALUES ( 'impt BakerHughesNam'[County] ) )
If above not help, please share some sample data with expect result for test.
Regards,
Xiaoxin Sheng
Hi All,
Im trying to get the delta between latest rig count and previous count (MoM change). My data has several dates (Publish Date) to get the right rig count number I need to use only the latest date of each month.
To get the latest date Im using this measure:
Hi @Anonymous ,
You can try to use following measure formula, I add a variable to get previous month max data based on current country group:
Previous Count = VAR currDate = MAX ( 'impt BakerHughesNam'[PublishDate] ) VAR prevDate = CALCULATE ( MAX ( 'impt BakerHughesNam'[PublishDate] ), FILTER ( ALLSELECTED ( 'impt BakerHughesNam' ), [PublishDate] < currDate && FORMAT ( [PublishDate], "mm/yyyy" ) = FORMAT ( DATE ( YEAR ( currDate ), MONTH ( currDate ) - 1, 1 ), "mm/yyyy" ) ), VALUES ( 'impt BakerHughesNam'[Country] ), VALUES ( 'impt BakerHughesNam'[County] ) ) RETURN CALCULATE ( SUM ( 'impt BakerHughesNam'[RigCount] ), FILTER ( ALLSELECTED ( 'impt BakerHughesNam' ), [PublishDate] = prevDate ), VALUES ( 'impt BakerHughesNam'[Country] ), VALUES ( 'impt BakerHughesNam'[County] ) )
If above not help, please share some sample data with expect result for test.
Regards,
Xiaoxin Sheng
Hey !
I used the Add Date function - 7 days ( as they publish every friday) and it worked!
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 |
---|---|
110 | |
97 | |
78 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |