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 want to sum the number of 'Activations' in the previous month. So if the report was run and viewed any time during say April (the current month), the 'previous month's figures would be for all of March.
I have a new measure on my fact table:
TotalActivationsPreviousMonth = CALCULATE(sum(fact_PatientActivations[TotalActivations]), PREVIOUSMONTH(dim_Date[D_Date]))
Results are not correct, expecting 101 but I get 57 (highlighted):
Here is the relationship between the date dimension and fact table
And this is the structure of the fact table:
I would expect the formula to sum all TotalActivations for the month of March. But it doesn't seem to be doing that.
Am I missing something obvious?
Hi @Anonymous ,
Would you please use the following measure :
TotalActivationsPreviousMonth =
CALCULATE (
SUM ( fact_PatientActivations[TotalActivations] ),
ALL ( fact_PatientActivations ),
PREVIOUSMONTH ( dim_Date[D_Date] )
)
If it doesn't meet your requirement, Could you please inform us more detailed information, such as d your sample data(by using OneDrive for Business) if possible? Then we will help you more correctly. Please don't contain any Confidential Information or Real data in your reply or files.
Best Regards,
Dedmon Dai
@Anonymous , your formula seems correct. Just check do you have timestamp in your date.
Change the data type to timestamp and view it in format to have time and check. It it has timestamp.
Date = [Datetime].date
Date = date(year( [Datetime]),month( [Datetime]),day( [Datetime]))
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 |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
106 | |
105 | |
86 | |
72 |