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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
rrhutch
Helper II
Helper II

Measure with new Date Slider Value

I have been doing some research on using slicer values for create dynamics measures. However, I am looking for some clarity of developing the measure, since this is my first run at it.

 

I have two tables:

 

                TableA has columns [Status] and [Decision Date]

                TableB has one column [Unique Decision Dates]

 

TableB has no relationship with TableA.

 

I am trying to use the new date slider option that was released in the latest version of PowerBI. I have the date slider using the values from TableB.[Unique Decision Dates]. The slider is including values “Before” the selected slider date.

 

Here is the measure that I am trying to accomplish.

 

If TableA.[Status] = “XX” or “XY” then “Yes”

If TableA.[Status] = “XT” or “XZ” and TableA.[Decision Date] <= TableB.[Unique Decision Dates] then “N” else “Y”

 

Thoughts on how best to accomplish this?

3 REPLIES 3

 

It is really not clear what you are trying to do.  Can you post some sample workbook and show the output you are expecting?



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Here is a link to an example PowerBI file.

 

Raw data looks like:

 

Capture1.PNG

I would want to create a new column that has values of something like 'Yes' or 'No' or '0' or '1' in TableA where if TableA.[Status] = 'XX' or 'XY' the result would be 'Yes', but if 'XT' or 'XZ' if would determine whether the result is 'Yes' or 'No' based on if TableA.[Decision Date] is <= to the Max date the user selects on the date slider that is pulling from TableB. I would use the 'Yes' or 'No' reuslt to filter the TableA results.

 

As an example, if the user set 1/11/16 the result would look like:

 

Capture2.PNG

 

Join your 2 tables on date.

 

Write this measure

Min Selected Date = FIRSTDATE(TableB[UNIQUE DECISION DATE])

and this

Display Result = if(HASONEVALUE(TableA[STATUS]),
	     				if(VALUES(TableA[STATUS]) in ("XX", "XY"),"Yes","No"),
						 if(min(TableA[Decision Date]) >=[Min Selected Date],"Y","N"))

I'm not sure if my logic is quite right, but you can probably fix it from there.


Here is the workbook https://www.dropbox.com/s/5vilq70ai8b02kq/Example.pbix?dl=0

 

Note that the in statement above is new.  It is not supported in the intellisense, but it does work.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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