Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
We want to get the lastest code smells # for each day by each Repo Name, so in the table below for 5/7/2024, we want to see Repo Name = A, Code Smells = 283619; Repo Name = B, Code Smells = 5079. For 5/8/2024, we want to see Repo Name = A, Code Smells = 290000; Repo Name = B, Code Smells = 6789.
The resulting dash would look something like this:
Your help would be greatly appreciated.
Thanks.
Solved! Go to Solution.
Step 0: I use your data below.
Step 1: I add 'Date' column and rename it on Power Query Editor.
Rename: 'Date' --> 'Last Analysys Date Only'
Step 2: I make 2 mesures below.
M_LatestTime = CALCULATE(MAX('DATA'[Last Analysys Date]),ALLEXCEPT('DATA',DATA[Repo Name],DATA[Last Analysys Date Only]))
M_MaxSmell = MAXX(FILTER('DATA','DATA'[Last Analysys Date]=[M_LatestTime]),'DATA'[CodeSmells])
Step 3: I make 2 Tables and a graph.
Step 0: I use your data below.
Step 1: I add 'Date' column and rename it on Power Query Editor.
Rename: 'Date' --> 'Last Analysys Date Only'
Step 2: I make 2 mesures below.
M_LatestTime = CALCULATE(MAX('DATA'[Last Analysys Date]),ALLEXCEPT('DATA',DATA[Repo Name],DATA[Last Analysys Date Only]))
M_MaxSmell = MAXX(FILTER('DATA','DATA'[Last Analysys Date]=[M_LatestTime]),'DATA'[CodeSmells])
Step 3: I make 2 Tables and a graph.
@ATZoeTang You will need an Index ( add in Power Query Editor ). Then you can create a Complex Selector like this:
Selector Measure =
VAR __CurrentIndex = MAX( 'Table'[Index] )
VAR __Date = MAX( 'Table'[Last Analysis Date] )
VAR __MaxIndex = MAXX( FILTER( ALL( 'Table' ), [Last Analysis Date] = __Date ), [Index] )
VAR __Result = IF( __CurrentIndex = __MaxIndex, 1, 0 )
RETURN
__Result
You then filter your visual for Selector Measure = 1. The Complex Selector - Microsoft Fabric Community