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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Stawik
Frequent Visitor

Filter and previousmonth returns blank

Hi I have problem with dax formula.

 

It looks like that

 

M-1 VOL = CALCULATE(SUM(Wnioski[Vol]); FILTER(Wnioski;Wnioski[ProductType] <> "Phones"); PREVIOUSMONTH(Data[DATE]))
 
And the result is blank, no errors
 
When I remove FILTER(Wnioski;Wnioski[ProductType] <> "Phones") then it works fine, also when I remove
PREVIOUSMONTH(Data[DATE])) it works fine, but together it do not work.
 
What I'm doing wrong?
1 ACCEPTED SOLUTION

HI with All it works better, but not ideal. Fortunatelly I have found workarround.

I have create two measures

 

VOL2 = CALCULATE(SUM(Sales[Vol]); FILTER(Sales;Sales[Typ produktu] = "Phones"))
 
Measure3 = CALCULATE([VOL2];PREVIOUSMONTH('Date'[DATE]))
 
And now Measure3 shows the data i need
 
pbi previousmonth.png

View solution in original post

5 REPLIES 5
v-lili6-msft
Community Support
Community Support

HI, @Stawik 

For your case, Just add ALL Function or ALLSELECTED Function in your formula as below:

M-1 VOL = CALCULATE(SUM(Wnioski[Vol]); FILTER(ALL(Wnioski);Wnioski[ProductType] <> "Phones"); PREVIOUSMONTH(Data[DATE]))

or

M-1 VOL = CALCULATE(SUM(Wnioski[Vol]); FILTER(ALLSELECTED(Wnioski);Wnioski[ProductType] <> "Phones"); PREVIOUSMONTH(Data[DATE]))

Then it will work well.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HI with All it works better, but not ideal. Fortunatelly I have found workarround.

I have create two measures

 

VOL2 = CALCULATE(SUM(Sales[Vol]); FILTER(Sales;Sales[Typ produktu] = "Phones"))
 
Measure3 = CALCULATE([VOL2];PREVIOUSMONTH('Date'[DATE]))
 
And now Measure3 shows the data i need
 
pbi previousmonth.png

hi @Stawik 


@Stawik wrote:

HI with All it works better, but not ideal. Fortunatelly I have found workarround.

I have create two measures

 

VOL2 = CALCULATE(SUM(Sales[Vol]); FILTER(Sales;Sales[Typ produktu] = "Phones"))
 
Measure3 = CALCULATE([VOL2];PREVIOUSMONTH('Date'[DATE]))
 
And now Measure3 shows the data i need
 
pbi previousmonth.png

It's pleasant that your problem has been solved, could you please mark the reply as Answered?  Smiley Very Happy

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

Will you able to share a sample pbix file after removing sensitive information. Typically it happens when there are non-continuous dates.

 

 

Hi amitchandak

 

Thanks for your help.

This is link to example file

 

https://isolutionpolska-my.sharepoint.com/:u:/g/personal/dstawicki_isolution_pl/EbvZneqJhw9IiNfxyl6a...

 

Best regards

Daniel Stawicki

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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