Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Noeleke1301
Helper II
Helper II

Coalesce combo with userelationship

Hi all,

I want to make a graph consisting of deliveries that are based on a date (A). However, this date does not always exist so I added a second date (B) as a fallback.

 

Date A is an active relationship to my date table. Date B is an inactive relationship to my date table.

The date dimension of my date table is on the X axis.

 

How can I write DAX to count the rows in my table, that first looks if date A exists and uses that relationship, and if not then date B with that relationship?

 

Date ADate B
x 
xx
x 
 x
 x
xx

 

Been breaking my head at this all morning but couldn't come up with a solution.

 

Thanks!

2 REPLIES 2
johnt75
Super User
Super User

You could create a new column, either in Power Query or DAX, which is A if that's not null otherwise its B. If you did it in Power Query you could probably delete both A and B afterwards. Wherever you create the column, create an active relationship to the date table instead of from either A or B.

Hi Johnt75,

I realise I can solve my problem with a calculated column, but I want to minimize the amount of columns I add to my table to keep everything more clear.

 

Is there any way I can do this in a measure?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors