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.
I have create a measure that uses some variables, to calculate a specific percentage. The measure is like the following example:
Measure =
VAR DifYears = SELECTEDVALUE(Table1[DifYears])
VAR __table1 = ALLSELECTED(Table2[YearSold]; Table2[YearHire]; Table2[DifYears])
VAR __table2 = ADDCOLUMNS(__table1; "Percentage"; [Calc Percentage])
VAR __table3 = FILTER(__table2; [Percentage] > 0)
VAR __table4 = GROUPBY(__table3; [DifYears]; "Final Percentage"; AVERAGEX(CURRENTGROUP(); [Percentage]))
VAR __table5 = SELECTCOLUMNS(FILTER(__table4; [DifYears] = DifYears); "Total"; [Final Percentage])
RETURN
__table5
It is a simple example, my problem is on the variable __table1.
I create a variable that is a table (bc. ALLSELECTED), and I have a slicer filter in a page and this measure should ignore the slicer filter YearHire, and this is my problem.
How I can create this variable (__table1) with this 3 columns but ignoring the slicer filter?
Try adding this to your expression.
VAR __table0 = CALCULATETABLE( Table2, ALLSELECTED( Table2[YearSold]; Table2[DifYears] ), ALL( Table2[YearHire] ) )
VAR __table1 = GROUPBY( __table0; Table2[YearSold]; Table2[YearHire]; Table2[DifYears] )
Hi @gluizqueiroz ,
How about creating a new table, which is only one column "YearHire"? This table is independent of other tables. Then, use this column as a slicer to filter.
If it not works, please show me your data structure and give me some example data, not real data.
Best Regards,
Icey
If possible please share a sample pbix file after removing sensitive information.
Thanks
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 |
---|---|
109 | |
96 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |