Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
Same dataset as the previous message as here:
I am trying to get a calculated column (FileSizeCompliant) that confirms a file size loaded with Folder option is under a MaxFileSize loaded as a measure.
Solved! Go to Solution.
Hi @MirceaAJ ,
As I understand it, for your first question, I think you are right, the legend in the bar chart is needed to calculate the columns, the metrics are not put in.
Column = IF('file_data'[File size (MB)]<='file_data'[Maximum file size (MB)],1,0)
If it is the case that one calculated column works and not in another, you can check the relational model and context (including filters); you can refresh or load the dataset; and you can check that the data type is correct. If you can provide your example dataset, it might be better to help you solve the problem.
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MirceaAJ ,
As I understand it, for your first question, I think you are right, the legend in the bar chart is needed to calculate the columns, the metrics are not put in.
Column = IF('file_data'[File size (MB)]<='file_data'[Maximum file size (MB)],1,0)
If it is the case that one calculated column works and not in another, you can check the relational model and context (including filters); you can refresh or load the dataset; and you can check that the data type is correct. If you can provide your example dataset, it might be better to help you solve the problem.
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MirceaAJ ,
I think your problem is that the context is not able to judge YES or NO correctly, based on your previous post, we could also be setting up a MEASURE to do so and see if that helps you.
measure = IF(
MAX('Table'[Attributes])<'Table'[MAXfilesize],"YES","NO")
I think my data may be too simplistic and may not fully reproduce your key problem, if you can provide me with example data, it may better address your question.
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Indeed I have a measure that works which is something along the lines of
FileSizeCompliancePercentageMeasure = (DIVIDE ( sum('Table'[Attributes.Size]), [MaxFileSize], 0 ))-1
I do -1 so that I can easily identify how much the file size is over or under . I also have a different measure with 1 and 0 so that I can nicely turn it into ticks and Xs
FileSizeComplianceMeasure = if(max('Table'[Attributes.Size]) < [MaxFileSize], 1, 0) .
This all seems to works fine. My problem is when I try to aggregate (I think that is the correct term) the measure. If I want to do a bar visual with X axis being file extension, Y axis being the count of files and Legend being if they are compliant or not, then I am afraid that will not work with measures - correct ? To achieve what I want I need a calculated column but it seems it does not work. In a previous project with a different PBi file but same logic, the calculated column worked just fine. so I am not sure what the problem is with this dataset.
Any help will be highly appreciated.
User | Count |
---|---|
73 | |
73 | |
39 | |
25 | |
23 |
User | Count |
---|---|
96 | |
93 | |
51 | |
43 | |
42 |