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 (first time poster but have used a lot of solutions provided within the pages)
I have a fact table that i need it identify a MoM (Month On Month) change by a certain measure. Which i can do however i now need to do it on a subset of the fact table. Only the records that have had a claim (for example the table has 10,000 records of which only 2,000 have a claim). I need to isolate the calculation to just these records. For all the measures so far this has been achieved with the filter function. However I now need to Filter on Date and a text field. (hope that all makes sense).
The code that i am trying to use (i think is correct as far as the syntax goes) is:
I think you've put the claim status check in the wrong place, in the middle of the check for month rank. Try
claimMoM =
VAR cLMeasy =
CALCULATE (
Key_measures[%Easy],
ALL ( Dim_datet ),
Dim_Datet[Month Rank]
= MIN ( 'DIM_DateT'[Month Rank] ) - 1,
Dim_ClaimStatus[ClaimSts] IN { "Fault", "Non-Fault" }
)
RETURN
IF ( cLMeasy = 0, BLANK (), Key_measures[%Easy] - cLMeasy )
@Shorey not sure but I copied the code you sent and seems there was a mix in the lines. I just replaced the lines, try this and tell me if you get the error:
claimMoM =
VAR cLMeasy =
CALCULATE (
Key_measures[%Easy],
ALL ( Dim_datet ),
Dim_Datet[Month Rank]
= MIN ( 'DIM_DateT'[Month Rank] ) - 1,
Dim_ClaimStatus[ClaimSts] IN { "Fault", "Non-Fault" }
)
RETURN
IF ( cLMeasy = 0, BLANK (), Key_measures[%Easy] - cLMeasy )
Thanks for your reply @SpartaBI that is much easier to read (i must get in the habit of laying the code like that). However I no longer get the error but it is returning the same result i had before i tried to put the fault non-fault filter in - which suggests it isn't filtering on this factor. I think it needs to be within the one calculation for the min statement. I moved it up to after the key_measure, but that didn't work either. (no error message just not the correct result).
Thanks for trying though.
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 |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |