Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I currently have a table where the data in one of the columns are of type string, like "100% 22 hours".
Let's say I want to create a custom visual that counts the amount of rows where the data in that column is greater than 100%. However, because the data is a string, to filter those rows I can't exactly use "GreaterThan" with the AdvancedFiltering API, like this:
let conditions: IAdvancedFilterCondition[] = [];
conditions.push({ operator: "GreaterThan", value: "100%" });
Let's also that I am not allowed to clean the dataset before inputting it into PowerBI. Is there a way for me to create a custom function that is responsible for the logic deciding which data gets filtered and pass it into the AdvancedFilter API, like below?
let conditions: IAdvancedFilterCondition[] = [];
conditions.push((data) : boolean => {
//Do some parsing logic to extract the percent number
//Do some logic to determine if extracted number is greater than 100
//return true or false
});
If not, how else could I achieve this filtering logic in this scenario?
Thanks.
It seems you can try to use Contains condition operator instead of LessThan to filter text values.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
User | Count |
---|---|
16 | |
5 | |
2 | |
1 | |
1 |
User | Count |
---|---|
22 | |
3 | |
3 | |
2 | |
2 |