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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
NikkiSavage
Helper II
Helper II

Same formula in separate column not working properly

I have two columns that I have added in a table. I want to look up against customer code and determine from separate tables whether an event has happened within the last 30 days.

For the one column, I have entered the below formula and it works perfectly:

 

Infections in last 30 days = var today = today()
return
calculate(countrows('Infections Raw Data'),
filter( all('Infections Raw Data'[CommencementDate]),
'Infections Raw Data'[CommencementDate] > today - 30 &&
'Infections Raw Data'[CommencementDate] <= today))
 
However, when I use the same formula in another column but filter out "type of incident", it returns the total count per place rather than per customer.
Falls in last 30 days = var today = today()
return
calculate(countrows('All Resident Incidents Raw Data'), ('All Resident Incidents Raw Data'[Type] = "fall"),
filter( all('All Resident Incidents Raw Data'[DateOfIncident].[Date]),
'All Resident Incidents Raw Data'[DateOfIncident].[Date] > today - 30 &&
'All Resident Incidents Raw Data'[DateOfIncident].[Date] <= today))
 
How do I get this to update to reflect customer code only rather than count of place.
 
I also want to do a similar column summing weight change in that date period from another table but can't get the formula to work. Any suggestions would be welcome.
 
Falls in last 30 days = var today = today()
return
calculate(countrows('All Resident Incidents Raw Data'), ('All Resident Incidents Raw Data'[Type] = "fall"),
filter( all('All Resident Incidents Raw Data'[DateOfIncident].[Date]),
'All Resident Incidents Raw Data'[DateOfIncident].[Date] > today - 30 &&
'All Resident Incidents Raw Data'[DateOfIncident].[Date] <= today))
 
Thanks!
2 REPLIES 2
Anonymous
Not applicable

Hi everyone, I'm new to power bi. Please help me separate the data from the virtual table into the corresponding tables as follows:

 

nghia69371_0-1623377922390.pngnghia69371_1-1623380055937.png

I want to separate the data lines and from the arrow to fill the data before the arrow in the columns in the respective tables, please help me, thanks a lot

 

v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Read this post to get your answer quickly.

How to Get Your Question Answered Quickly - Microsoft Power BI Community


Best Regards,
Henry

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors