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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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