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

View all the Fabric Data Days sessions on demand. View schedule

Reply
ALDOBES
Frequent Visitor

Dax Measure - Ignore Selectedvalue[date], then filter [date2] on selectedvalue[date]

I have a measure similar to the below (context changed)
However it doesn't work, it just returns all rows of the table by the selectedvalue[ReceivedDate] still.

I need it to create a linegraph showing
line A: the total number of 'sausages' received in a period 
line B: the total number of 'sausages' 'reallyratherbadlyburnt' in a period


Dead Sausages (Use Received Date as Cooked Date) =
VAR SelectedFromDttm =
    SELECTEDVALUE ( 'DD Log'[Received Date] )
RETURN
    CALCULATE (
        COUNTROWS ( 'DD Log' ),
        FILTER ( ALL ( 'DD Log'[ReceivedDate] ), 'DD Log'[CookedDate] = SelectedFromDttm ),
        'DD Log'[SausageStatus] = "reallyratherbadlyburnt"
    )


Also Tried 


Dead Sausages (Use Received Date as Cooked Date) =
VAR SelectedFromDttm =
    SELECTEDVALUE ( 'DD Log'[Received Date] )
RETURN
    CALCULATE (
        COUNTROWS ( 'DD Log' ),
        FILTER ( ALL ( 'DD Log'[CookedDate] ), 'DD Log'[CookedDate] = SelectedFromDttm ),
        'DD Log'[SausageStatus] = "reallyratherbadlyburnt"
    )

 

and

 

Dead Sausages (Use Received Date as Cooked Date) =
VAR SelectedFromDttm =
    SELECTEDVALUE ( 'DD Log'[Received Date] )
RETURN
    CALCULATE (
        COUNTROWS ( 'DD Log' ),
        FILTER ( ALL ( 'DD Log'), 'DD Log'[CookedDate] = SelectedFromDttm ),
        'DD Log'[SausageStatus] = "reallyratherbadlyburnt"
    )

 

Same results.

 

Please help.

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

This should work. 

  1. Create a Calendar Table
  2. Create a relationship (Many to One and SIngle) from The Cooked Date column to the Date column of the Calendar Table
  3. Create a Date slicer from the Calendar Table and select any date/date range
  4. Write this measure

Measure = COUNTROWS ( 'DD Log' )

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Might be easier to help  if you could provide sample data and show the expected result.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors