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.
I have three tables: Business Calendar, Cost, and Project with sample data and column structure provided below:
I want to create a measure to calculate monthly cost such that if today is between current month business day and next month business day, then calculate total cost for previous month. For example, today is between March business day, and next month business day, so calculate Feb cost for each project. Also, if I refresh data next month on April business day (and between this day and May business day), the cost should automatically reflect for the month of March. I also want to do the same for YTD. Any helps would be appreciated!
Hi Nick,
The below measure basically sums up all the cost as per current month i.e. business calendar based on your system date.
TOTAL_EXPENSE_TD = CALCULATE(SUM(COST[COST]),COST[MONTH]<MONTH(TODAY) && COST[YEAR]=YEAR(TODAY()))
Regards,
Saurabh Kedia
@Anonymous,
You may try to use RANKX Function and take a look at https://www.sqlbi.com/articles/lookup-multiple-values-in-dax/.
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |