Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi everyone!
When I tried to convert text into number, this error showed up: Cannot convert value " of type Text to type Number. It's probably because there are some empty strings. So I tried to convert them into 0. But again, the same error showed up and I don't know why. Could you help me figure out with this? Thanks in advance.
Here's my dax function:
Count# = VALUE(COALESCE([Count], 0))
[Count] is the original attribute in text format.
Solved! Go to Solution.
Hi @Anonymous ,
Please check the following results:
Measure 3 = VAR _t =ADDCOLUMNS('Table',"Total",SUMX(FILTER(ALL('Table'),[planning cycle]=EARLIER([planning cycle])),[Measure 2]))
RETURN MAXX(_t,[Total])
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please check the following results:
Measure 3 = VAR _t =ADDCOLUMNS('Table',"Total",SUMX(FILTER(ALL('Table'),[planning cycle]=EARLIER([planning cycle])),[Measure 2]))
RETURN MAXX(_t,[Total])
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I made simple samples and you can check the results below:
Measure = IF(VALUE(MAX('Table'[Value]))=BLANK(),0,VALUE((MAX('Table'[Value]))))
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi Scott,
Thanks.
I tried your way but still failed. Is it because my raw data has something like this? two types of blank?
Hi @Anonymous ,
Try replacing blank() with ""
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
it says can't compare type of number with type of text.
Hi @Anonymous ,
Please try:
Measure = IF(MAX('Table'[Value])="",0,VALUE(MAX('Table'[Value])))
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
Thanks it works. But how can I sum up these number by different dimension?
Hi @Anonymous ,
Depends on your individual needs, for example, if you need to take the value of column A as 1 for summing, you can use the following expression:
Measure = CALCULATE([measure],FILTER('Table',[A]=1))
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
what if I want to show the total count of each planning cycle?
here's my raw data:
planning cycle | product name | measure |
19 | A | 0 |
19 | B | 1 |
20 | C | 1 |
20 | D | 1 |
20 | E | 0 |
I want to get summary table like this:
planning cycle | measure |
19 | 1 |
20 | 2 |
Measure = Count(Yourtable[Count])
or share the file to help you
Thanks for your help. I tried but failed again. and I'm sorry I'm afraid I can't share the file because of the confidentiality.
pls try this
or this
Thanks. But it turned to be that Count# is different with Count, do you know why is that?
show how you wrote the measure
you wrote a column and you need to write your measure [Count]
write like this
Measure = IFERROR(CONVERT([Count],INTEGER),0)
But [Count] is actually a column. How can I write a measure based on a column?
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 |
---|---|
76 | |
76 | |
57 | |
36 | |
34 |
User | Count |
---|---|
99 | |
56 | |
56 | |
46 | |
40 |