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.
Hello fellow PowerBi users,
right now i have a column in a table, which i dragged into a "card". So depending on (clicking on a custom diagram) it filters out all the unneeded rows and just shows data from some rows.
But if i dont click anything/dont have any filter applied i want to show nothing instead of the first value of the column. So i wanted to use a measure, but i am not sure how to create it exactly. I thought of something like this:
----------------------------------
Measure=
VAR _count = COUNTROWS(Table)
Return
if( _count>10, " ", Table(Description) )
-----------------------------------
(or maybe MAX or Concatentate before Table(Description) before it so it isnt a "naked" column reference) but it doesnt work eighter.
So my question is: How do i show all aggregated data of one filtered column in one cell together in a card, but if its unfiltered and has more then a certain amount of rows (10) it doesnt show anything?
(but if sombody has an idea what i did wrong at my basic attempt without the aggregation i would be thankful as well)
Thank you a lot:)
Strathos
Solved! Go to Solution.
Hi @Anonymous ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below:
Measure =
VAR _count =
COUNTROWS ( ALLSELECTED ( 'Table' ) )
VAR _combinedtext =
CONCATENATEX ( VALUES ( 'Table'[Description] ), 'Table'[Description], "," )
RETURN
IF ( NOT ( ISFILTERED ( 'Table'[Item] ) ) || _count > 10, BLANK (), _combinedtext )
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
You can make use of HASONEFILTER-
https://docs.microsoft.com/en-us/dax/hasonefilter-function-dax
If(HasOnefilter( Table(Description)),Countrows(Table),Blank())
thx, didn't know that, but sadly it doesn't work as the visual doesn't apply a real filter that PowerBi can detect, it just temporarily removes the rows somehow.
So i still have to do it with the COUNTROWS function somehow.
If you want to show blank if row count increases 10, you cna try this:
Noofrows =
var _count = CALCULATE(CountRows(ALLSELECTED(Table)))
return
if(_count>10,BLANK(),_count)
i am sry to bother you again, but with this it only shows the var _count if the rows are less then 10. How do i do it to give back the value (text) from the "filtered" rows of column Table[Description] itself ?
((or the text of all rows showing of the column combined))
Hi @Anonymous ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below:
Measure =
VAR _count =
COUNTROWS ( ALLSELECTED ( 'Table' ) )
VAR _combinedtext =
CONCATENATEX ( VALUES ( 'Table'[Description] ), 'Table'[Description], "," )
RETURN
IF ( NOT ( ISFILTERED ( 'Table'[Item] ) ) || _count > 10, BLANK (), _combinedtext )
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |