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 a report that currently have about 20 cards on it, showing various bits of data, but with the nature of "Cards", it always wants to show the first value of its respective column if there is no filtering. I therefore have a measure for each card that looks like...
Solved! Go to Solution.
I was thinking about this last night, and a way to reduce the code to speed up the running of the code...
Country_Measure = IF(ISFILTERED('Carrier Matrix'[Region]) && HASONEVALUE('Carrier Matrix'[Region]) || ISFILTERED('Carrier Matrix'[Country]) && HASONEVALUE('Carrier Matrix'[Country]) || ISFILTERED('Carrier Matrix'[Carrier]) && HASONEVALUE('Carrier Matrix'[Carrier]) || ISFILTERED('Carrier Matrix'[OData__2_Contractstatus/planning]) && HASONEVALUE('Carrier Matrix'[OData__2_Contractstatus/planning]), IF(COUNT('Carrier Matrix'[Key]) =1, LASTNONBLANK('Carrier Matrix'[Country]," "), " "), " ")
and thinking about what the code does, it checks to see if any filters are applied and then only displays data in a card if there is only 1 row. Therefore, I could remove the checking of filter steps and simply count the number of rows, reducing the overhead processing.
Country_Measure Test= IF(COUNT('Carrier Matrix'[Key]) =1, LASTNONBLANK('Carrier Matrix'[Country]," "), " ")
Does anyone see any issue with the above? I have tested and seems to work.
@StuartSmith , I think you have followed this way only. The only thing is you have parenthesis on && statement
(ISFILTERED('Carrier Matrix'[Region]) && HASONEVALUE('Carrier Matrix'[Region])) || ()
I was thinking about this last night, and a way to reduce the code to speed up the running of the code...
Country_Measure = IF(ISFILTERED('Carrier Matrix'[Region]) && HASONEVALUE('Carrier Matrix'[Region]) || ISFILTERED('Carrier Matrix'[Country]) && HASONEVALUE('Carrier Matrix'[Country]) || ISFILTERED('Carrier Matrix'[Carrier]) && HASONEVALUE('Carrier Matrix'[Carrier]) || ISFILTERED('Carrier Matrix'[OData__2_Contractstatus/planning]) && HASONEVALUE('Carrier Matrix'[OData__2_Contractstatus/planning]), IF(COUNT('Carrier Matrix'[Key]) =1, LASTNONBLANK('Carrier Matrix'[Country]," "), " "), " ")
and thinking about what the code does, it checks to see if any filters are applied and then only displays data in a card if there is only 1 row. Therefore, I could remove the checking of filter steps and simply count the number of rows, reducing the overhead processing.
Country_Measure Test= IF(COUNT('Carrier Matrix'[Key]) =1, LASTNONBLANK('Carrier Matrix'[Country]," "), " ")
Does anyone see any issue with the above? I have tested and seems to work.
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |