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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors