Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I have 2 variable like as bellow :
Var1 = SUMMARIZE(
ORDDTS,
ORDDTS[ID_CUSTOMER]
, "MINORDER",MIN(ORDDTS[ID_ORDERDATE])
)
Var2 = SUMMARIZE(
ORDDTS,
ORDDTS[ID_CUSTOMER]
, "MAXORDER",MAX(ORDDTS[ID_ORDERDATE])
)
I want to filter the customer who have MaxOrder-MinOrder>100
i did the code as bellow but doesn't work
CALCULATE(NATURALINNERJOIN(var1, var2), VALUES('var1'[MINORDER]) - VALUES('var2'[MAXORDER])>100)
Any idea how can i do that ?
Thanks for help !
Solved! Go to Solution.
Hi @Anonymous
Not sure what exactly are trying to achieve. I guess this is a 100 days difference between first and last orders. Please try
Table1 =
VAR T1 =
ADDCOLUMNS (
SUMMARIZE ( ORDDTS, ORDDTS[ID_CUSTOMER] ),
"@MINORDER", CALCULATE ( MIN ( ORDDTS[ID_ORDERDATE] ) ),
"@MAXORDER", CALCULATE ( MAX ( ORDDTS[ID_ORDERDATE] ) )
)
VAR T2 =
FILTER ( T1, [@MAXORDER] - [@MINORDER] = 100 )
RETURN
T2
Hi @Anonymous
Not sure what exactly are trying to achieve. I guess this is a 100 days difference between first and last orders. Please try
Table1 =
VAR T1 =
ADDCOLUMNS (
SUMMARIZE ( ORDDTS, ORDDTS[ID_CUSTOMER] ),
"@MINORDER", CALCULATE ( MIN ( ORDDTS[ID_ORDERDATE] ) ),
"@MAXORDER", CALCULATE ( MAX ( ORDDTS[ID_ORDERDATE] ) )
)
VAR T2 =
FILTER ( T1, [@MAXORDER] - [@MINORDER] = 100 )
RETURN
T2
@tamerj1 I want to sperate two variables because the second variable contains others filters
@Anonymous
Please provide the complete picture otherwise it would be difficult to provide your with proper answer.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 14 | |
| 8 | |
| 8 | |
| 8 |