Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
112 | |
105 | |
94 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |