Wednesday, 13 December 2023

Create custome sort in Power BI

In Power BI, you can achieve custom sorting by creating a separate column that defines the sort order for your "state" column. Here's a general guide:
Create a Sort Order Column:
  • Create a new column in your table, let's call it "Sort Order."
  • Assign a numerical value to each state based on your desired sorting order.
Sort by the New Column:
  • In your visualizations or tables, sort by the newly created "Sort Order" column rather than the original "state" column.
This way, you can define a custom sort order for your states independent of alphabetical order.
For example, if you want to sort by population size, you might assign a number to each state based on its population.
If you provide more details about your sorting criteria, I can give you a more specific example.
If you want to sort your "state" column based on a custom order like "planned - New - Accepted - done - Resolved - Closed," you can follow these steps:

Create a Custom Sort Order Column:

Create a new column (let's call it "CustomSortOrder") and assign a numerical value to each state based on your desired order. For example:
Planned: 1
New: 2
Accepted: 3
Done: 4
Resolved: 5
Closed: 6
Sort by the Custom Sort Order Column:

In your Power BI visualizations or tables, sort by the "CustomSortOrder" column rather than the original "state" column.
This way, your states will be sorted according to the custom order you defined in the "CustomSortOrder" column.

Monday, 11 December 2023

Advantages of dataflows

 Using dataflows in Power BI can offer several advantages over a direct connection to a large data source, especially when dealing with performance issues. Here are some advantages of using dataflows:

Data Transformation and Preparation:


Dataflows allow you to perform ETL (Extract, Transform, Load) operations in a separate step from the report creation. This means you can transform and clean the data in a more structured and optimized way before it reaches the report, improving efficiency.

Data Compression:


Dataflows automatically apply data compression techniques, reducing the amount of data transferred and stored. This can lead to faster refresh times and improved overall performance.

Incremental Refresh:


With dataflows, you can implement incremental refresh strategies, where only the new or modified data is refreshed instead of refreshing the entire dataset. This is particularly useful for large datasets as it significantly reduces refresh times.

Parallel Processing:


Dataflows allow for parallel processing during data transformation and loading, distributing the workload across multiple nodes. This can lead to faster data processing times compared to a sequential processing approach.

Separation of Concerns:


By using dataflows, you separate the data preparation and transformation logic from the report creation. This enhances maintainability and makes it easier to troubleshoot and debug issues related to data transformation.

Reuse of Data Transformations:


Dataflows can be reused across multiple reports and dashboards. Once you define a set of transformations, you can use them in different contexts without duplicating effort. This promotes consistency in data preparation and reduces redundancy.

Data Storage in the Power BI Service:


Dataflows can store data in the Power BI service, reducing the need to repeatedly transfer large datasets over the network. This can result in faster report rendering times and a more responsive user experience.

Optimized Data Models:


Dataflows can create optimized data models, which can result in better query performance when users interact with the report. This is because dataflows can aggregate and summarize data in a way that is tailored to the reporting requirements.

Scheduled Refresh:


Dataflows can be scheduled to refresh at specific intervals, ensuring that the data is always up-to-date without requiring manual intervention. This is crucial for maintaining the accuracy of reports over time.

Integration with Power Query:


Dataflows leverage the Power Query engine for data transformation, providing a familiar and powerful tool for users already accustomed to working with Power Query in Power BI Desktop.

By leveraging these advantages, dataflows can significantly improve the efficiency and performance of your Power BI reports, especially when dealing with large and complex datasets.