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.
I'm trying to create a measure that sums up the number of unique ids (Session IDs) over a group (Account ID) only where date 1 is less than date 2.
I have managed to only execute for the correct rows but my calculation sums up all rows per Account ID.
Any suggestions?
Solved! Go to Solution.
Hi @Anonymous ,
You can follow the below steps to get it:
1. Create a calculated column to get the flag using compare date 1 and date 2
Flag = IF('data'[date1]<'data'[date2],1,0)
2. Create a measure to get the count of sessions
Measure =
VAR _tab=SUMMARIZE(FILTER(ALLEXCEPT('data','data'[Account Id]),'data'[Flag]=1),"countofSession",CALCULATE(DISTINCTCOUNT('data'[Session ID])))
RETURN IF(MAX('data'[Flag])=1,SUMX(_tab,[countofSession]))
Best Regards
@Anonymous , Try a measure like
sumx(values(data[Account ID]), calculate(Distinctcount(data[SessionID])))
Hi @Anonymous ,
You can follow the below steps to get it:
1. Create a calculated column to get the flag using compare date 1 and date 2
Flag = IF('data'[date1]<'data'[date2],1,0)
2. Create a measure to get the count of sessions
Measure =
VAR _tab=SUMMARIZE(FILTER(ALLEXCEPT('data','data'[Account Id]),'data'[Flag]=1),"countofSession",CALCULATE(DISTINCTCOUNT('data'[Session ID])))
RETURN IF(MAX('data'[Flag])=1,SUMX(_tab,[countofSession]))
Best Regards
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 |
---|---|
108 | |
98 | |
78 | |
65 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |