Forum Discussion
Conditional Filter
- 4 years ago
Ah, yes, that makes sense. My bad.
This is always going to be a cyclic reference as you're applying this as a step in your fact table.
Revert your DateMin/Max queries back to how they were originally, then try this as your final fact table step:
Table.SelectRows( #"Personnalisee ajoutee", each [Date] >= (DateMin ?? #date(1900,01,01)) and [Date] <= (DateMax ?? #date(2999,12,31)) )Pete
Hi BA_Pete
Thanks I feel we are close, however I tried the code left DateMax null when I refreshed I got this error message
Expression.Error: A cyclic reference was encountered during evaluation.
I am attaching pictures of my three M codes
First One is my Sales Table
Second One is my DateMin
Third One is my DateMax
Sales Table
Ah, yes, that makes sense. My bad.
This is always going to be a cyclic reference as you're applying this as a step in your fact table.
Revert your DateMin/Max queries back to how they were originally, then try this as your final fact table step:
Table.SelectRows(
#"Personnalisee ajoutee",
each [Date] >= (DateMin ?? #date(1900,01,01))
and [Date] <= (DateMax ?? #date(2999,12,31))
)
Pete
- Einomi4 years agoHelper V
Works Perfect 😁
Many thanks
PS : if you have a few min to send me links about the ?? or to explain it to me you are more than welcome
always want to learn and share
- BA_Pete4 years agoSuper User
In Power Query, ?? is the coalesce operator i.e. it converts null values to a chosen value.
In the case of (X ?? Y) this translates to "if X is null then Y".
Pete