Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Conditional count on how many times someone has been 1st in rank over a month

Hi everyone,

 

Below is a table I have made illustrating the total views per id, where whenever someone is 1st, 2nd or 3rd I am displaying a unichar instead.

 

Capture1.PNG

 

What I would like as shown in the second picture, is to be able to count how many times someone had been first over a month.

 

E.g When having dates for November, id(ieg) is 1st, where I would be able to count and put a number for all times someone has been 1st. (In december (next month), it could be that ieg will not be first, but he still should have 1 in his warehouse from last month. Progressively, the new person getting the 1st in december, he should get 1 in his warehouse.

 

Capture3.PNG

 

Could someone help on how to write that formula?

 

Thanks a lot in advance 🙂

1 REPLY 1
Anonymous
Not applicable

Assuming the measure [Rank] calcuated the rank by # views properly (and not swapping 1 - 3 for your UNICHAR...which is a really slick idea!), try this measure:

 

Warehouse of Trophies = 
//	For each ID, create a table that calculates the view rank for each month in the current filter context
VAR Rank_by_Month = 
	ADDCOLUMNS(
		VALUES(dim_Calendar[Month])
		,"View Rank", [Rank]
	)
//	Only keep the months where the product was ranked # 1
VAR Months_Top_Rank = 
	FILTER(
		Rank_by_Month
		,[View Rank] = 1
	)
//	Count the number of times the product was ranked #1
VAR Result = 
	COUNTROWS(Months_Top_Rank)
RETURN
Result

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.