Dynamic Calculation Group for Data Quality Validation Based on Selected Columns #1404
Replies: 1 comment
-
Hi @sonnyvb I must admit that I am a bit bewildered about how you describe your requirements. Your example includes five different calculations; however, a measure or calculation item can only return one scalar value. Therefore, you need to choose one of those variables to return or create five separate measures to achieve what you need. Another option is to use Power Query to create Data Profiling tables and to have in your report environment shown by Reza Rad: |
Beta Was this translation helpful? Give feedback.
-
Hello,
I would like to create a Calculation Group in my Power BI model that allows me to dynamically apply a specific measure based on the selected column. Specifically, I want to implement a data quality rule that checks whether a column contains blank values, total valueas, .
The idea is as follows:
My goal is to make this dynamic and reusable so that users can choose which column they want to validate in the report environment.
For example:
DQM CountryOfOrigin =
VAR TotalRows = COUNTROWS(view_BI_M_Part)
VAR TotalEmptyRows = COUNTROWS(
FILTER(
view_BI_M_Part,
ISBLANK(view_BI_M_Part[CountryOfOrigin]) ||
TRIM(view_BI_M_Part[CountryOfOrigin]) = "" // Checks for empty strings or spaces
)
)
VAR TotalFilledRows = TotalRows - TotalEmptyRows
VAR PercentageEmptyRows = DIVIDE(TotalEmptyRows, TotalRows, 0)
VAR PercentageFilledRows = DIVIDE(TotalFilledRows, TotalRows, 0)
Is this possible? If yes, how can I implement this using Tabular Editor 3 and Power BI?
Beta Was this translation helpful? Give feedback.
All reactions