Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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,