Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Dear All
I am new to Powewr BI but I am truly enjoying what it is able to do fo rme
I have however hit a snag and am struggling with getting my head around a solution
In one column I have "Service Type" and in another column I have the week numbers
I am trying to create a measure that counts the number of occurencies of the "Service Type" if the Week number column is showing the latest week number (I.E the maximum week number in the column)
Unfortunately I have hit a wall and can't see the solution would anyon ebe able to advise me please
Regards
Kevin
Solved! Go to Solution.
Given this Enter Data query:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk4tKstMTlUwVNJRMjZRitUhKGRohCJkhKkKLGSMImQMFYoFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Service = _t, WeekNum = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Service", type text}, {"WeekNum", Int64.Type}}) in #"Changed Type"
Create these measures:
MAXWeekNum = CALCULATE(MAX(Services[WeekNum]),ALL(Services)) CountWeekNum = COUNT(Services[WeekNum]) CountCurrentWeekNum = CALCULATE([CountWeekNum],FILTER(Services,Services[WeekNum] = [MAXWeekNum]))
Given this Enter Data query:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk4tKstMTlUwVNJRMjZRitUhKGRohCJkhKkKLGSMImQMFYoFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Service = _t, WeekNum = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Service", type text}, {"WeekNum", Int64.Type}}) in #"Changed Type"
Create these measures:
MAXWeekNum = CALCULATE(MAX(Services[WeekNum]),ALL(Services)) CountWeekNum = COUNT(Services[WeekNum]) CountCurrentWeekNum = CALCULATE([CountWeekNum],FILTER(Services,Services[WeekNum] = [MAXWeekNum]))
Hi smoupre
Thank you for the swift reply it is appreciated
I have applied the measures as you suggested and that has indeed solved my problem thank you
Kevin
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
61 | |
56 | |
55 | |
36 | |
34 |
User | Count |
---|---|
77 | |
73 | |
45 | |
45 | |
43 |