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 have two columns one is of ID and other is of Date, ID is repeating on different dates but I want to calculate the first count of ID,
let supose ID "111" is created on 1-08-2022, then on 2-08-2022, 3-08-2022, and 5-08-2022, but I want to show the count of ID "111" on 1-08-2022 rest of the dates count should be blank for the ID "111"
Solved! Go to Solution.
@Ubaid . Create a flag and use that in filter
a new column
flag = if([Date] = minx(filter(Table, [ID] =earlier([ID]) ), [Date]) , 1, 0)
Hi @Ubaid,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi,
Please check the below picture and the attached pbix file.
It is for creating a measure.
Count of ID measure: =
VAR _currentdate =
MAX ( Data[Date] )
VAR _currentidlist =
VALUES ( Data[ID] )
VAR _currentidlistbeforecurrent =
SUMMARIZE (
FILTER ( ALL ( Data ), Data[ID] IN _currentidlist && Data[Date] < _currentdate ),
Data[ID]
)
VAR _currentidcount =
COUNTROWS ( _currentidlist )
VAR _beforecurrentidcount =
COUNTROWS ( _currentidlistbeforecurrent )
RETURN
IF ( HASONEVALUE ( Data[Date] ), _currentidcount - _beforecurrentidcount )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@Ubaid . Create a flag and use that in filter
a new column
flag = if([Date] = minx(filter(Table, [ID] =earlier([ID]) ), [Date]) , 1, 0)
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 |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |