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.
Hello,
I have a strange count requirments requirements. I want to count ID occurence for each day if ID rpeat next day it should not be counted. The outcome should be based on below attached picture.
It would be quite helpfulif I get it solved.
Thank you
Solved! Go to Solution.
Hi @Junaid11 ,
Please create below measures:
Flag = CALCULATE(MAX('Table'[AccountID]),FILTER(ALL('Table'), [AccountID]=MAX('Table'[AccountID])&& [Date]=MAX('Table'[Date])-1))
Count = COUNTROWS(FILTER('Table',[Flag]=BLANK()))
Combine =
var _t=SUMMARIZE(FILTER('Table',[Date]=MAX('Table'[Date]) && [Flag]=BLANK()),[AccountID])
return CONCATENATEX(_t,[AccountID],",",[AccountID],ASC)
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Junaid11 ,
Please create below measures:
Flag = CALCULATE(MAX('Table'[AccountID]),FILTER(ALL('Table'), [AccountID]=MAX('Table'[AccountID])&& [Date]=MAX('Table'[Date])-1))
Count = COUNTROWS(FILTER('Table',[Flag]=BLANK()))
Combine =
var _t=SUMMARIZE(FILTER('Table',[Date]=MAX('Table'[Date]) && [Flag]=BLANK()),[AccountID])
return CONCATENATEX(_t,[AccountID],",",[AccountID],ASC)
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Junaid11
Please add a calcualted colum which deterines if it should be counted as followes:
CountValue=
VAR this_row_account=Table[AccountID]
VAR this_row_date=Table[Date]
VAR Account_Present_Yesterday=
CALCULATE(COUNTROWS(Table),
FILTER(Table
,Table[AccountID]=this_row_account && Table[Date]=this_row_date-1)
RETURN
IF(Account_Present_Yesterday>0,Blank(),Table[AccountID])
Then - on the visual - count CountValue column.
Hope it helps,
David Ganor
Hello @David-Ganor ,
Yeah it is working for the count but can't we get the concatenation as (A,B,C,D,E) as mentioned?
@Junaid11 I'm not sure really...
Please try to make a measure using
CONCATENATEX
Something like this:
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 |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |