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.
Dear everbody
Please help to caculcate Runrate month to day base on history Lastmonth.
I have list seller perfomance daily . So i want calculate MTD (End of Month) how many order they can reach base on perfomance last month.
I have Grass_date / Shopid / Orders.
So what 's best metric Runrate ? please help
Solved! Go to Solution.
May I ask if this is the expected output you are looking for? Based on your description, since I'm not sure of your specific needs, I've used two methods to achieve the effect you're looking for. Following picture shows the effect of the display.
Method 1:
Measures:
LastMonthOrders =
CALCULATE ( SUM ( 'Table'[orders] ), PREVIOUSMONTH ( 'Table'[grass_date] ) )
DaysInLastMonth =
COUNTROWS (
FILTER (
ALL ( 'Table'[grass_date] ),
MONTH ( 'Table'[grass_date] ) = MONTH ( EDATE ( TODAY (), -1 ) )
&& YEAR ( 'Table'[grass_date] ) = YEAR ( EDATE ( TODAY (), -1 ) )
)
)
AvgDailyOrdersLastMonth =
DIVIDE ( [LastMonthOrders], [DaysInLastMonth] )
DaysMTD =
COUNTROWS (
FILTER (
ALL ( 'Table'[grass_date] ),
'Table'[grass_date] >= DATE ( 2023, 12, 1 )
&& 'Table'[grass_date] <= TODAY ()
)
)
MTDRunRate =
[AvgDailyOrdersLastMonth] * [DaysMTD]
Method 2:
Measures:
DaysInLastMonth =
COUNTROWS (
FILTER (
ALL ( 'Table'[grass_date] ),
MONTH ( 'Table'[grass_date] ) = MONTH ( EDATE ( TODAY (), -1 ) )
&& YEAR ( 'Table'[grass_date] ) = YEAR ( EDATE ( TODAY (), -1 ) )
)
)
LastMonthOrders =
SUMX (
FILTER ( 'Table', MONTH ( 'Table'[grass_date] ) = MONTH ( TODAY () ) - 1 ),
'Table'[orders]
)
AvgDailyOrdersLastMonth =
SUMX (
FILTER ( 'Table', MONTH ( 'Table'[grass_date] ) = MONTH ( TODAY () ) - 1 ),
'Table'[orders]
) / [DaysInLastMonth]
MTDRunRate =
[AvgDailyOrdersLastMonth] * [DaysMTD]
DaysMTD =
VAR StartDate =
EOMONTH ( TODAY (), -1 ) + 1
VAR EndDate =
TODAY () + 1
RETURN
DATEDIFF ( StartDate, EndDate, DAY )
If this does not work, could you please share some clear sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
May I ask if this is the expected output you are looking for? Based on your description, since I'm not sure of your specific needs, I've used two methods to achieve the effect you're looking for. Following picture shows the effect of the display.
Method 1:
Measures:
LastMonthOrders =
CALCULATE ( SUM ( 'Table'[orders] ), PREVIOUSMONTH ( 'Table'[grass_date] ) )
DaysInLastMonth =
COUNTROWS (
FILTER (
ALL ( 'Table'[grass_date] ),
MONTH ( 'Table'[grass_date] ) = MONTH ( EDATE ( TODAY (), -1 ) )
&& YEAR ( 'Table'[grass_date] ) = YEAR ( EDATE ( TODAY (), -1 ) )
)
)
AvgDailyOrdersLastMonth =
DIVIDE ( [LastMonthOrders], [DaysInLastMonth] )
DaysMTD =
COUNTROWS (
FILTER (
ALL ( 'Table'[grass_date] ),
'Table'[grass_date] >= DATE ( 2023, 12, 1 )
&& 'Table'[grass_date] <= TODAY ()
)
)
MTDRunRate =
[AvgDailyOrdersLastMonth] * [DaysMTD]
Method 2:
Measures:
DaysInLastMonth =
COUNTROWS (
FILTER (
ALL ( 'Table'[grass_date] ),
MONTH ( 'Table'[grass_date] ) = MONTH ( EDATE ( TODAY (), -1 ) )
&& YEAR ( 'Table'[grass_date] ) = YEAR ( EDATE ( TODAY (), -1 ) )
)
)
LastMonthOrders =
SUMX (
FILTER ( 'Table', MONTH ( 'Table'[grass_date] ) = MONTH ( TODAY () ) - 1 ),
'Table'[orders]
)
AvgDailyOrdersLastMonth =
SUMX (
FILTER ( 'Table', MONTH ( 'Table'[grass_date] ) = MONTH ( TODAY () ) - 1 ),
'Table'[orders]
) / [DaysInLastMonth]
MTDRunRate =
[AvgDailyOrdersLastMonth] * [DaysMTD]
DaysMTD =
VAR StartDate =
EOMONTH ( TODAY (), -1 ) + 1
VAR EndDate =
TODAY () + 1
RETURN
DATEDIFF ( StartDate, EndDate, DAY )
If this does not work, could you please share some clear sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hii @ducvan1987
Use the below measure to find the MTD orders
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 |
---|---|
104 | |
96 | |
80 | |
67 | |
62 |
User | Count |
---|---|
137 | |
106 | |
104 | |
81 | |
63 |