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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jwin2424
Resolver I
Resolver I

Count based on two date columns.

Alright. I am really hoping someone can help here. 

I am trying to provide a conversion rate for my opportunities. 

jwin2424_0-1721345647151.png


I have two seperate visuals here giving me the correct results. My issue is that I have 4 date columns here. 
[Estimated Close Year]

[Estimated Close QTR]

[Actual Close Year]

[Actual Close QTR]

 

I need to get the conversion rate by taking what actually closed divided by what was estimated to close. Here is the result I need. 


Year  / QuarterExpected to Close as WonActually WonAccuracy
2024   
114411479.17%
259723739.70%
3328329.76%
456  


I do NOT have a relationship with a calendar table because I have too many date columns and there isnt one specific date column that would be appropriate to use as a primary key. I tried this, but it doesn't work:

Estimated Close Opps =
CALCULATE(
    DISTINCTCOUNT(Opportunity[OPP ID]),
    Opportunity[Estimated Close Year] = Opportunity[Actual Close Year] &&
    Opportunity[Estimated Close Quarter] = Opportunity[Actual Close Quarter]
)

I need the visual to have the year and quarter in the rows, but I need to select a date column to do that. If I choose the actuals, it still applies that as a filter and doesnt give me the correct result. Because the estimated value is based on the estimated dates and the actual value is based on the actual dates, I don't know how to create a measure that says 

Give me the count of the opportunities where the estimated close year and quarter equals the year and quarter in the row

Give me the count of the opportunities where the actual close year and quarter equal the year and quarter in the row

Then divide the actual by the estimated and give me the %

 

Hoping this makes sense and you can help! 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

 

@jwin2424 

you can create a dim date table. Then for more than one date column, only one column's relationship can be active. Others are inactive. If you want to make those inactive relationship to be active, you can try USERELATIONSHIP function.

 

https://learn.microsoft.com/en-us/dax/userelationship-function-dax?wt.mc_id=DP-MVP-5004616

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

 

@jwin2424 

you can create a dim date table. Then for more than one date column, only one column's relationship can be active. Others are inactive. If you want to make those inactive relationship to be active, you can try USERELATIONSHIP function.

 

https://learn.microsoft.com/en-us/dax/userelationship-function-dax?wt.mc_id=DP-MVP-5004616

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I am going to mark this as the answer. I youtubed it, and this was a good explination of it. 

Using USERELATIONSHIP in DAX (youtube.com)

It was specific to the different dates as well. You got me in the right direction. Thank you!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I am still not sure how that will work in the visual. Which date would go in the rows? 

then could you pls provide some sample data?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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