cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nischal Regular Visitor
Regular Visitor

the below dax is returning blank i want only for last day

Lastday = CALCULATE(DISTINCTCOUNT(survey_reports[responseId]), LASTDATE(date1[Date].[Date]))

8 REPLIES 8
Nischal Regular Visitor
Regular Visitor

last day count throwing error of duplicate dates

Lastday = CALCULATE(DISTINCTCOUNT(survey_reports[responseId]), LASTDATE(survey_reports[date]))

 

if I am using the date from the date table its showing blank...... need to fix this **bleep**

tnx in advance

Re: the below dax is returning total i want only for last day

Hi @Nischal

 

Do you have a screenshot showing the error (and the visuals)


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Nischal Regular Visitor
Regular Visitor

Re: the below dax is returning total i want only for last day

Screenshot (15).pngblank is the visual

Nischal Regular Visitor
Regular Visitor

Re: the below dax is returning total i want only for last day

Lastday = CALCULATE(DISTINCTCOUNT(survey_reports[responseId]),LASTDATE(date1[Date]))

Re: the below dax is returning total i want only for last day

Hi @Nischal

 

The LASTDATE function is probably returning the very last day in your Date table - which probably goes off into the future.  I'm wondering if you actually need the date of the most recent transaction?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Nischal Regular Visitor
Regular Visitor

Re: the below dax is returning total i want only for last day

yes! you are right !! I need the date of a most recent transaction .... I have used the max function  to get the end date in the date table so that should not be the issue

Re: the below dax is returning total i want only for last day

Cool, then can you please share the names of the columns in your transaction table


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Nischal Regular Visitor
Regular Visitor

Re: the below dax is returning total i want only for last day

when I create a relationship between date table and survey table the visual gets blank if I delete the relationship it is giving me a total

 

 columns in the transaction table

 

survey id 

question

answer

store id

response id

date

motion 

 

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)