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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ML222
Frequent Visitor

Create Opening Measure - 2 Columns of Dates to equal inactive Date table Value from Slicer

Hi,

Here I have:

ML222_0-1697202957809.png

- Fact Table with 2 Date columns ( DIM_DAY_KEY & VALUE_DIM_DAY_KEY)
- A Date Table with an active relationship to the Fact table

- A Comparison Date table with an Inactive relationship to the Fact Table

My Canvas looks like this:

ML222_1-1697203162410.png

Comparison Date = Compairson Date Table with Inactive Relationship
Report Date = Date Table with Active Relationship


The calulation I require is to work out the Opening Coverage.
I need to use a Divide Function.

For the numerator I need the Sum of Value Where:
DIM_DAY_KEY = The Value of Comparision Date
&& VALUE_DIM_DAY_KEY = The Value of Comparision Date

For the denominator I need the Opening Value which is quite simply:

ML222_3-1697203617749.png

 

ML222_2-1697203385798.png

 

I have tried a number of different DAX formulas but they either return blank, or timeout. The actual table is very large.
Here's a couple I've tried:

ML222_4-1697203690743.png

 

 

ML222_5-1697203893010.png

 

Any Idea's on where I am going wrong in my DAX?

Thank you

 

1 ACCEPTED SOLUTION

Hi @amitchandak,

Thank you. That video helped although I did not acheive the result with your method.
In my instance; I need to apply the 'FromDate' to where both the Primrary date and the Secondary Date (from my Fact table) equal the selected 'From Date' Value. When trying to solve with just one calculate, the DAX would return blanks.

I was able to get it to work using the following DAX:

ML222_0-1697460651704.png

 

This works. Performance seems good.
If you see a way to get this solved in one calculate, that would be ideal. However, I have managed to figure that one out yet.


View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@ML222 , Refer the approach I used

 

Power BI Abstract Thesis: How to use two Date/Period slicers

https://youtu.be/WSeZr_-MiTg

 

Select data between months - https://youtu.be/nEt7dT3Tfv4

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak,

Thank you. That video helped although I did not acheive the result with your method.
In my instance; I need to apply the 'FromDate' to where both the Primrary date and the Secondary Date (from my Fact table) equal the selected 'From Date' Value. When trying to solve with just one calculate, the DAX would return blanks.

I was able to get it to work using the following DAX:

ML222_0-1697460651704.png

 

This works. Performance seems good.
If you see a way to get this solved in one calculate, that would be ideal. However, I have managed to figure that one out yet.


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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