Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Overview:
I have a date based table in which I have the following columns:
ID, Date (from today's date to historical date) (ex. March 21 2023, March 20 2023, March 19 2023 etc), Plan Type and Amount.
I am using the following formula:
I need help fixing my measure to get the required result. Thank you in advance.
Try replacing the [Date Key] with whatever ID column you're using in the date table, or the field used in the relationship between the two tables.
Potential issue with the 'Measure 6' formula is related to the filter context of the 'Plan Type' column. When you use the ALL function on the 'Plan Type' column, it removes the filter context of that column, which is causing the same value to appear in every row of the 'Measure 6' column.
To fix this issue, you can use the VALUES function to get a table of distinct values in the 'Plan Type' column and iterate over them using the SUMX function. Here is an updated formula that should work:
Measure 6 =
SUMX (
VALUES ( 'Worker Compensation Detail All'[PLAN TYPE] ),
CALCULATE (
SUM ( 'Worker Compensation Detail All'[PAY RATE_] ),
FILTER (
ALL ( 'Worker Compensation Detail All'[PLAN TYPE] ),
'Worker Compensation Detail All'[Date Key] = MAX ( 'Worker Compensation Detail All'[Date Key] )
)
)
)
I hope I am understanding your issue correctly and hope this helps
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
86 | |
86 | |
84 | |
67 | |
49 |
User | Count |
---|---|
131 | |
110 | |
97 | |
71 | |
67 |