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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.