Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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,
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
70 | |
54 | |
38 | |
31 |
User | Count |
---|---|
83 | |
64 | |
63 | |
49 | |
45 |