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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
crispybc
Frequent Visitor

Parametrized Date in DAX Created Sankey Table

I have created a Sankey table using DAX which is basically  just SOURCE, DESTINATION, WEIGHT (Summarised ticket data at different states).

 

I have a variable date set up to filter the data for tickets created after the variable date, however I want to make this date value changable outside of the DAX. I have not been able to figure out how to do this.

 

Here is a very dumbed down example of the DAX:

CX-JOURNEY = VAR from_date = DATEVALUE("2022-07-01")
RETURN
{
(
"PRE-SALES",
"SUPPORT",
CALCULATE(COUNTROWS(CONVERSATIONS), CONVERSATIONS[CREATED_AT] > from_date && CONVERSATIONS[GROUP]="Pre-Sales Engineers")
),
(
"SUPPORT",
"RND",
CALCULATE(COUNTROWS(CONVERSATIONS), CONVERSATIONS[CREATED_AT] > from_date && CONVERSATIONS[GROUP]="SUPPORT" )
)
}

 

Basically the goal is to have from_date selectable from outside the visual and have the Sankey visual update based on the selected date.

2 REPLIES 2
crispybc
Frequent Visitor

Hi @amitchandak 

It seems to not be able detect the values within the table.

 

TEST = VAR from_date = SELECTEDVALUE(Date2[Date])
RETURN
{
(
"PRE-SALES",
"SUPPORT",
CALCULATE(COUNTROWS(CONVERSATIONS), CONVERSATIONS[CREATED_AT] > from_date && CONVERSATIONS[GROUPS]="Pre-Sales Engineers"),
from_date
),
(
"SUPPORT",
"RND",
CALCULATE(COUNTROWS(CONVERSATIONS), CONVERSATIONS[CREATED_AT] > from_date && CONVERSATIONS[GROUPS]="SUPPORT" ),
from_date
)
}

 I added from_date as a 4th value to the table and it returns null values. I confirm the date slicer works with a simple measure. 

Measure = SELECTEDVALUE(Date2[Date])

crispybc_0-1669207521857.png

But it does not work within table creation dax.

 

 

 

crispybc_1-1669207763569.png

 

Any Ideas?

amitchandak
Super User
Super User

@crispybc , Create an independent date table and then use

 

selectedvalue(Date1[Date])

 

or

 

maxx(allselected(Date1),[Date])

 

in place of static date

 

Just for reference

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors