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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gianluca79
Frequent Visitor

how to pass slicer value in calculate table

Hi,

I have a fact table Fact_Scontrini to which a date time dimension and a customer dimension are connected.
STAR_SCHEMA.png

 

I want replicate this oracle statement whit use of a time slicer to select the minimum and maximum of a date, and pass the values ​​into a measure:

SELECT
MEM.K_MEMBER
FROM Dim_Member_Dormienti MEM
WHERE NOT EXIST
(
SELECT REC.K_MEMBER
FROM FACT_SCONTRINI REC
WHERE REC.K_MEMBER=MEM.K_MEMBER
AND REC.DataScontrino >= "DATA MIN SLICER"
)
and MEM.DATA_ADESIONE_MEMBRO <="DATA MAX SLICER"

 

The measure work fine:

_ClientiDormienti 3 Mesi =
VAR _UltimoScontrino= MAX(Dim_Data[DateKey])
VAR _ClientiDal = MIN (Dim_Data[DateKey])
VAR _ScontriniEsistenti = CALCULATETABLE(VALUES(Fact_Scontrini[K_Member]);Dim_Data[DateKey]>=_UltimoScontrino)  
VAR _ClientiAderentiDall =
CALCULATETABLE(
    VALUES(Dim_Member_Dormienti[K_MEMBER]);Dim_Data[DateKey]<=_ClientiDal)  

VAR _RESULT =EXCEPT(_ClientiAderentiDall;_ScontriniEsistenti)  
RETURN
COUNTROWS(_RESULT)

 

 

The count works correctly, but what if I also want to create a detail table of the k_members and not just the count?
In the table doesn't work correctly the value of slicer.

 

Please Help me.

 

Regards

Gianluca 

2 REPLIES 2
Gianluca79
Frequent Visitor

@Mahesh0016 but what is in the link is not for me. I'm supposed to filter a table that I'm supposed to build dynamically and I can't pass slicer filters in the formula

Mahesh0016
Super User
Super User

@Gianluca79 Refer below link if its not helps you , please share ENDOUT in table.
Fields parameters in Power BI - SQLBI

 

@Gianluca79 THANK YOU!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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