Forum Discussion
Displaying Table Fields as Rows in DirectQuery
- 7 months ago
Hi akim_no , when you are transforming your data using Dataflowgen 2 , the power query editor , you can add a conditional coloumn, the condition:
if Value contains "Yes" then 1
if Value contains "No" then 1
else 0
In your Power BI Report write a measure:Completion Rate % =DIVIDE([Actual Entries],DISTINCTCOUNT('After ETL'[Field Name]) * DISTINCTCOUNT(Sheet1[Record_ID ]),0)
This would give you the total completion rate for the entire data set and also change dynamically.
This is also suited for slicer selection and card visuals:Hope this works.
- 7 months ago
Hi akim_no ,
The earlier approach was based on a Static values (such as Yes/No). However, to make the solution more flexible, here’s a dynamic approach to calculate the completion rate.
Based on your reference table, I created an unpivoted table named "Post_ETL", where all fields are transformed into rows.In this structure, the "Value" column can contain multiple types of entries and is no longer limited to specific values like Yes or No.
Measure to calculate completion countHow the measure works:
- It filters only those rows where the Value is not blank
- Then it counts the total number of actual entries present for each record
- This ensures the count dynamically updates based on the underlying data
Measure to calculate completion rate%
For the completion rate:
- Use Actual_Entries as the numerator
- Use (Distinct count of Fields × Distinct count of Records) as the denominator
- Format as Percentage.
This calculation provides the overall completion rate, considering only non-blank entries and dynamically adjusting based on the data and applied filters.
Hope this helps!
Right, InsightsByV this approach makes a lot of sense.
Performing the transformation at the source (e.g., using Dataflow Gen2) would definitely help reduce refresh overhead and improve overall report performance.
If we try to handle this within Power BI in DirectQuery mode, it would require creating a disconnected table and additional DAX logic such as Datatable and Switch , which can become difficult to maintain as the number of fields grows.
So pushing this logic upstream is a much more scalable and cleaner approach.