Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |