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.
Hi,
I just begin with PowerBI and I would like to create a report where the user can select somes values from segments in order to sort the table, not filtering.
For example :
and when the user chooses :
So I have disabled the automatic filtering with the "Edit interactions" options in order to keep all the lines in my table but now, I am not able to calculate the segment value in my table. So I can't compare the segment value with the table value to calculate the score.
I get the segment value through this solution :
https://community.powerbi.com/t5/Desktop/How-to-get-filter-values-applied-to-a-label-displayed-in-Re...
but it doesn't work in my case.
How i can obtain the segment value in my table when i have disabled the filter ?
Thank you ?
Solved! Go to Solution.
Hi @Anonymous
To achieve this you will need to create two dimensions, one for weapons and second for protection and a measure like below.
Score = VAR _weapon = CALCULATE( COUNTROWS( 'Table' ), ALL( 'Protection'[Protection] ) ) VAR _protection = CALCULATE( COUNTROWS( 'Table' ), ALL( Weapon[Weapon] ) ) RETURN _weapon + _protection + 0
Hi @Anonymous
To achieve this you will need to create two dimensions, one for weapons and second for protection and a measure like below.
Score = VAR _weapon = CALCULATE( COUNTROWS( 'Table' ), ALL( 'Protection'[Protection] ) ) VAR _protection = CALCULATE( COUNTROWS( 'Table' ), ALL( Weapon[Weapon] ) ) RETURN _weapon + _protection + 0
OK, if i calculate the selectedvalue with this formula, I can do the comparaison :
Hi @Anonymous
Sorry, for the late reply, please see the attached solution.
I've split the original score measure into two to achieve this.
Score Protection = CALCULATE( COUNTROWS( 'Table' ), ALL( Weapon[Weapon] ) )
Score Weapon = CALCULATE( COUNTROWS( 'Table' ), ALL( 'Protection'[Protection] ) )
Score = [Score Weapon] + [Score Protection] + 0
Please see the attached file for reference.
Your solution is equally as good, so you might stick to it!
Thank you for the tip, it works perfectly !!!
But now, i have another problem.
I would like to change the font color if the table value matches with the segment value.
So, i would like to compare these 2 values.
But the SelectedValue(table[Weapon]) or the SelectedValue(table[Protection]) is not empty only for the line matches with 2 choices, so the comparaison fails :
How can I do ?
Best Regards,
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 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |