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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Jonas1
Helper I
Helper I

Missing values for specific rows in matrix when using previousmonth()

Hi, 

 

I have set up an income statement with four rows, total to date, year to date (for chosen month), chosen month and previous month. Year, month, specific project etc. is chosen with different filters.

 

Everything seems to be working perfectely besides for one thing: if the chosen month does not contain values on any of the rows, there will not be a value showing on that row for previous month either. Does anyone know how to fix this? 

 

My formula for the provious month is: 

CALCULATE('AllAcTr - Alle Selskap'[Beløp m. Res.];PREVIOUSMONTH(Dato[Date]))

 

I have set up the total row in the bottom with its own formula, so this is always correct. 

 

Attached is an example. As you can see the first four rows (income) contains values for the previous month, it does not show however. 

Skjermbilde.PNG

1 ACCEPTED SOLUTION
Jonas1
Helper I
Helper I

Finally solved my problem. 

 

Showed out the reason for my problem was that I had a two-way relation between my date-table and Fact table. When I changed this to a one-way connection everything worked out. 

 

So seems like the two-way relation made the Fact table filter my previousmonth()-formula in my matrix for detail lines where the value for the current month was zero. Might make sense when I think of it, but took me a long time to realise...

View solution in original post

2 REPLIES 2
Jonas1
Helper I
Helper I

Finally solved my problem. 

 

Showed out the reason for my problem was that I had a two-way relation between my date-table and Fact table. When I changed this to a one-way connection everything worked out. 

 

So seems like the two-way relation made the Fact table filter my previousmonth()-formula in my matrix for detail lines where the value for the current month was zero. Might make sense when I think of it, but took me a long time to realise...

Jonas1
Helper I
Helper I

Where

Beløp m. Res. = if(HASONEFILTER('Gruppering regnskapskonti'[Res. Type]);sum('AllAcTr - Alle Selskap'[Beløp tab.]);'AllAcTr - Alle Selskap'[Resultat])
 
Beløp tab. is the value per account just fixed so it will always be positive, while Resultat is the final result (the total). 

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 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.

October NL Carousel

Fabric Community Update - October 2024

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