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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Pratik1802
Regular Visitor

Create a measure to get the entire month value based on selected date.

Hi, I am trying to build a report which needs a DAX that I am having some trouble with. 

 

I have a table which has the following structure:

Pratik1802_0-1685829184710.png

I want to create a report using a matrix visual that looks like:

Pratik1802_1-1685829238750.png

The issue that I am facing is wit hthe Month Amount_EUR measure. The user is going to select any 1 date (Invoice date) in th date slicer and then based on that the report should show the Month Amount for that entire month. One more point to note is that there may not be any invoice created for a specific country- legal entity pair for that selected date but there many by a value for some other date in that month. So in this case as well we should get the month amount_eur value. 

 

Any helo would be much appriciated and if you need more information or something is not clear please let me know.

 

Thanks!

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Pratik1802 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

vtangjiemsft_0-1685946541742.png

(2) We can create a table and a measure. 

vtangjiemsft_1-1685946850924.png

 

Table 2 = VALUES('Table'[INVOICE_DATE])
month amount_eur = 
 var _a=SELECTEDVALUE('Table 2'[INVOICE_DATE])
 var _b= CALCULATE(SUM('Table'[Today Amount_Eur]),FILTER(ALL('Table'),'Table'[COUNTRY_ID]=MAX('Table'[COUNTRY_ID]) && 'Table'[LEGAL_ENTITY_ID]=MAX('Table'[LEGAL_ENTITY_ID]) && YEAR('Table'[INVOICE_DATE])=YEAR(_a) && MONTH('Table'[INVOICE_DATE]) =MONTH(_a)))
 return _b

(3) Then the result is as follows.

vtangjiemsft_2-1685946897405.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Pratik1802 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

vtangjiemsft_0-1685946541742.png

(2) We can create a table and a measure. 

vtangjiemsft_1-1685946850924.png

 

Table 2 = VALUES('Table'[INVOICE_DATE])
month amount_eur = 
 var _a=SELECTEDVALUE('Table 2'[INVOICE_DATE])
 var _b= CALCULATE(SUM('Table'[Today Amount_Eur]),FILTER(ALL('Table'),'Table'[COUNTRY_ID]=MAX('Table'[COUNTRY_ID]) && 'Table'[LEGAL_ENTITY_ID]=MAX('Table'[LEGAL_ENTITY_ID]) && YEAR('Table'[INVOICE_DATE])=YEAR(_a) && MONTH('Table'[INVOICE_DATE]) =MONTH(_a)))
 return _b

(3) Then the result is as follows.

vtangjiemsft_2-1685946897405.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.