Business Analytics and Visualization

Image
It has been a while since I posted a blog article.  Things have been busy and unfortunately my blog has suffered.  Not only have I been busy working in the Microsoft Dynamics 365 and Power Platform arena, but I have also been teaching at a local university.  This past semester I taught Business Analytics and Visualization.  It was a fun course to teach and I was able to introduce business students to the power of analytics using both Power BI and Tableau.  The text for the course was Introduction to Business Analytics, 1 st Edition by Vernon Richardson & Marci Watson.  The text did a great job of covering the types of analytics and the mindset and approach you should follow as a business analyst.  I recently used some of this material in a presentation at an FPnA conference, and it was well received, so I thought I would put the thoughts together here for everyone to read. In today's data-driven world, the ability to transform raw data into meanin...

USERELATIONSHIP in DAX


A common problem many users face it the fact that there are multiple date fields in their tables, and when they want to use a date dimension, Power BI only allows for on active relationship between the two tables.

For example, I have a dimension table from my leasing software that included information on each lease including the commencement date of the lease and the expiration date of the lease.  In Power BI when I use a separate date dimension (which I always recommend for many different reasons), I can only link the dimension table to date table with one active relationship.   See screen shot below.




Since most of my visualizations will be based on the Commencement Date, I will make that the active relationship.  However, I would like to create a visualization showing my leases by expiration date.  In order to do this, I have a couple options.

1.       I could create a second date dimension table in my model.  This is fairly simple.  I would just copy the first dimension and give it a new name (Expiration Date).  I would relate the Lease Details table to the Expiration Date table using the expiration date.  The drawback to this is if you are using date slicers on the report, you would need two different date slicers since they are different tables.  This can also quickly get out of control if there are numerous dates.

2.       I could use the DAX function USERELATIONSHIP.

Userelationship([columnName1],[columnName2])

The function returns no value; the function only enables the indicated relationship for the duration of the calculation.

By using this function I can create a new measure to count my leases based on their expiration date.

Expiring Leases = CALCULATE(DISTINCTCOUNT('Lease Details'[Lease]),USERELATIONSHIP('Lease Details'[ExpirationDate],'Date'[Date]))

Once this measure is in place, I can create my two different visualization using the same date dimension.







Comments

Popular posts from this blog

RPA with Dynamics 365 Finance & Supply Chain

Using Full Page Apps in Dynamics 365 Finance

Copilot Dynamics 365 Finance & Supply