Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Ok resorting to posting on here for help. I am trying to find the difference between how many orders have left a state and how many have came into a state. Below is how my data is set up:
destination state date delivered date shipped order id shipper state orders
TX 1/1/2019 1/1/2019 12315 IL 1
AL 1/1/2019 1/1/2019 12642 NY 1
Hi @Anonymous ,
You can try to use following measure formula to calculate leave and arrive count based current date and state:
leave count = VAR currDate = MAX ( calendar[Date] ) RETURN CALCULATE ( COUNT ( Table[ID] ), FILTER ( ALLSELECTED ( Table ), currDate IN CALENDAR ( Table[Date delivered], Table[date shipped] ) && [Date delivered] <> currDate && [date shipped] <> currDate ), VALUES ( Table[shipper state] ) ) arrived count = VAR currDate = MAX ( calendar[Date] ) RETURN CALCULATE ( COUNT ( Table[ID] ), FILTER ( ALLSELECTED ( Table ), [date shipped] = currDate ), VALUES ( Table[destination state] ) )
If above not help, can you please explain more about your requirement?
Regards,
Xiaoxin Sheng
Hi @Anonymous ,
You can write a measure with variable summarize table(state, leave count, coming count), then use iteration function VARX.P/VARX.S on summary table to calculate variance.
Regards,
Xiaoxin Sheng
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
72 | |
38 | |
31 | |
27 |
User | Count |
---|---|
91 | |
50 | |
44 | |
40 | |
35 |