Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
Help, please.
I have this requirement:
I have a text column with text and number values, and I need to count separately each type. Based on the image, I will have:
Can I do that?
Additionally....
If I a change data type within Power BI, this will affect my data stored in SharePoint Online? E.g.: If I change my text column format to integer within Power BI.
Thanks in advanced.
Solved! Go to Solution.
Following @AlexisOlson 's answer, you can try this
Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table',NOT(ISERROR(VALUE('Table'[CONTENT])))&&NOT (ISBLANK('Table'[CONTENT]))))
Proud to be a Super User!
Hi @efebo
You can make some changes to your dax formula as the following.
var Num=COUNTROWS(FILTER('Table','Table'[values]<>""&&NOT(ISERROR(VALUE('Table'[values])))))
var Txt=COUNTROWS(FILTER('Table','Table'[values]<>""&&ISERROR(VALUE('Table'[values]))))
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You could count the number of rows that can convert to a number without throwing an error.
VarNum =
COUNTROWS (
FILTER ( Table1, NOT ISERROR ( VALUE ( Table1[RiesgoRegistrar] ) ) )
)
VarTxt = COUNTROWS ( Table1 ) - [VarNum]
Changing types in Power BI should not affect SharePoint at all. It should only be reading, not writing to SharePoint.
Hi @AlexisOlson
It worked, thanks. However, I have an issue: empty cells (no data). I downloaded the data from SharePoint and I opened it in Excel. This is what I found:
250 items:
- 56 cells with text values in the "RegistroRegistrar" column.
- 120 cells with number values in the "RegistroRegistrar" column.
- 74 cells with no data (empt) in the "RegistroRegistrar" column.
VarTxt is 56 which is OK. Howerver, VarNum is 194 (I think that number is the result of 120 cells with number values + 74 cells with no data (empty)).
How can we excluse cell with no data (empty).
Thanks again.
Following @AlexisOlson 's answer, you can try this
Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table',NOT(ISERROR(VALUE('Table'[CONTENT])))&&NOT (ISBLANK('Table'[CONTENT]))))
Proud to be a Super User!
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |