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
rajanimaddala
Helper II
Helper II

DAX Measure issue

Hi

I have 2 tables in power bi desktop model.

 

Payments(PayDate, CostCode, Amount)

CostCodeMapping(CostCode, Region, Directorate)

I have 1 to many relationship between CCMapping and Payments

 

I have measure to calculate TotalAmount till the selected month(slicer)

 

Total Amount = CALCULATE(SUM(Payments[Amount]), FILTER(ALL(Payments), PayDate <= today() && Payments[CostCode] IN VALUES(CCMapping[CostCode])))

 

It is working fine when displayed in table with PayMonth, TotalAmount

 

Now, I have pulled Region in the table visual. Issue here...

TotalAmount for region is showing entire CostCode total not by Region

 

I thought I need to add one more clause in the DAX as Region in values(CCMapping[Region] but Payments doesn't have Region field

 

How can I fix the issue?

 

Thanks in advance

 

6 REPLIES 6
rajanimaddala
Helper II
Helper II

Thank you all. I have fixed the issue

 

Great,

What was the issue?

Please mark the post as Solved for the rest of the community

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

PaulDBrown
Community Champion
Community Champion

@rajanimaddala 

Can you post an image of the final visual?

I have a feeling you don't need the filter expression "&& Payments[CostCode] IN VALUES(CCMapping[CostCode])", given you have aone-to-many relationship bewteen your tables.

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






aj1973
Community Champion
Community Champion

Can you share a dummy of your PBIX please?

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

aj1973
Community Champion
Community Champion

Hi,

In your Model change the relationship from single to Both.

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Hi,

I have changed the relationship to Both but still no luck

 

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.