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
Anonymous
Not applicable

Comparaison between slicer date and data date with measure

Hello , 

 

I own set of data with 6 columns like this under power bi :

 

Sans titre.png

 

With measure and a slicer I want show in a table or matrix severals columns. The slicer must be built with the "date" column, similar to a calendar .

 

All columns that I want show in table/matrix of exit  :

 

key column

date min choise in the slicer by a user

date max choise in the slicer by a user

column with start date in function of key

colum with finish date in function of key

a binary system (1 or 0)  to compare the "date min choise from the slicer" with the "date start" , here the comparaison it's >/=/<

a binary system (1 or 0)  to compare the "date max choise from the slicer" with the "date finish" , here the comparaison it's >/=/<

 

Thanks to help me to obtain only with a measure (not in column mode 😉 )

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

I create a sample that you can reference.

Date Min = 
var mi = MIN('Date'[Date])
return
SWITCH(TRUE(),MAX('Table'[date start])>mi,-1,MAX('Table'[date start])=mi,0,MAX('Table'[date start])<mi,1)

Date Max = 
var ma = MAX('Date'[Date])
return
SWITCH(TRUE(),MAX('Table'[date finish])>ma,-1,MAX('Table'[date finish])=ma,0,MAX('Table'[date finish])<ma,1)

Case 1Case 1Case 2Case 2

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
saraMissBI
Resolver I
Resolver I

Hello @Anonymous ,

 

The time intelligence features in power bi provide slicers with so much capabilities that I think you won't need a measure. I am not clear on all the columns you described. Could you provide a sample result of what you would like the table to contain, please?

 

Best regards,

 

Anonymous
Not applicable

Hello, 

 

4 cases to illustrate the wanted result :

 

dgdfgdfgdfg.png

Hi @Anonymous ,

I create a sample that you can reference.

Date Min = 
var mi = MIN('Date'[Date])
return
SWITCH(TRUE(),MAX('Table'[date start])>mi,-1,MAX('Table'[date start])=mi,0,MAX('Table'[date start])<mi,1)

Date Max = 
var ma = MAX('Date'[Date])
return
SWITCH(TRUE(),MAX('Table'[date finish])>ma,-1,MAX('Table'[date finish])=ma,0,MAX('Table'[date finish])<ma,1)

Case 1Case 1Case 2Case 2

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello ,

 

Thanks for this solution , I write the formulas on my calculation .

 

 

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.