Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hello all,
the subject has been already discussed but I can't find a way to achieve what I need.
The use case is the following:
For some computers if a reboot is needed I have a value "1" if the reboot is not required then it's "0".
When I use a card visual, I want to display all the computers which need to reboot, I can filter the computers where reboot is needed is equal "1". It works well
But if all my computers have already rebooted, means all of them have a value equal "0", in the visual I have "Blank". instead of "0".
I can't find a way to replace the blank value by "0".
Do you have an idea?
Any help would be appreciated, Thanks
Nico
Solved! Go to Solution.
Hi @nicolas_q ,
I can reproduce your problem. I think this should be caused by your data model. You table should look like as below.
And you use count function in value field in card visual and filter [Reboot] column to get result. When you show items when the value is not 0 in [Reboot], Power BI couldn't find any hostname and it will return blank. Blank in Power BI logic is same as 0.
If you don't want to show blank in card visual, please try to create measure.
Count hostname =
CALCULATE(COUNT('Table'[hostname]))+0
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @nicolas_q ,
When you get data from your sql source, what is data type?
How that data look, like 1 is shown as 1 and 0 is shown as 0 or blank/null?
If it is blank/null and data type is number, then first convert data type to text. Because replace function in power query can only replace null or blank with something if it is text.
Then replace null or blank with 0.
Then you can convert back the column to whole number if needed.
Hi @nicolas_q ,
You can modify your measure to include + 0.
MyMeasure =
[My Original Measure or Aggreation) + 0
//-0 will also work, 0 + will also work
Proud to be a Super User!
Thanks for sharing this simple and easy solution. Thank you!
Hi, thanks for you reply,
Well i'm really new into BI, I'm sorry but I don't understand.
I collect the data from SQL database, it arrives into a column with a 0 or 1 values.
In the visual, I get the column but I didn't not create a measure.
I don't know what kind of measure i can add?
Here what I have:
Thank for you help
Hi @nicolas_q ,
I can reproduce your problem. I think this should be caused by your data model. You table should look like as below.
And you use count function in value field in card visual and filter [Reboot] column to get result. When you show items when the value is not 0 in [Reboot], Power BI couldn't find any hostname and it will return blank. Blank in Power BI logic is same as 0.
If you don't want to show blank in card visual, please try to create measure.
Count hostname =
CALCULATE(COUNT('Table'[hostname]))+0
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Had this exact problem and found this thread. Your suggestion to create the "+0" measure worked perfectly. Thanks for the advice!
Hello,
thanks for your help, i've tried several things, and i could find this solution :
Hi @nicolas_q ,
If I misunderstood in my first reply and you are just interested to hide blank of card visual (but it will not still show as 0, will just hide text (Blank):
Pls refer below link:
Hi @nicolas_q,
The kind of aggregation in a measure will actually vary and they may or may not yield the same result.
Measure1 =
CALCULATE ( COUNTROWS ( Sheet1 ), FILTER ( Sheet1, Sheet1[hostname] <> 0 ) ) + 0
//this seems to be the closest to your use case
Measure2 =
CALCULATE ( SUM ( Sheet1[hostname] ) ) + 0
//assuming that summing up hostname is equivalent to counting each row in it that has a value of 1
Proud to be a Super User!
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
96 | |
91 | |
82 | |
69 |
User | Count |
---|---|
159 | |
125 | |
116 | |
111 | |
95 |