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
JustinDoh1
Post Prodigy
Post Prodigy

Calculate the difference on the value from cell (from two tables)

I am sharing my Pbix file here.

(Sorry I updated original post dramatically after I realized that I had relationship created between two tables, and this question might not be directly related to DAX command only)

 

I am trying to display column called "Managed Medical Skilled" in "Budget" table.

(I have been trying to fix this for more than a day... and this task is little urgent..  😞   )

 

So, "Variance" table subtracts value from "Actual" to "Budget".

For example, FacilityCode 810, Hospice:

8 - 6 = 2.

 

1st issue:

Column "Managed Medical Skilled" column does not show up on "Budget" table.

JustinDoh1_0-1634254926219.png

 

 

2nd issue:

Calculation of difference for "Managed Medical Skilled" column does not show up in "Variance" table.

JustinDoh1_0-1634255022477.png

 

 

Main reason is that in "Budget" table, there is no data for that column.

JustinDoh1_2-1634250981848.png

 

 

 

For calculation of Variance, I created a joined key called "JoinKey", and created a relationship between two tables ("Acutal" & "Budget").

JustinDoh1_1-1634253958393.png

 

I created a separate table called "Payer" with all PayerName values.

Is there anyway to modify the relationship between "Payer" table and "Budget" table so that all PayerName values (including "Managed Medical Skilled") show up in "Budget" table (and it might possibly resolve the issue)?  

 

JustinDoh1_0-1634255901764.png

 

How do we go about resolving these two issue in DAX or in table relationship?

 

 

Thanks.

1 ACCEPTED SOLUTION
ERD
Super User
Super User

Hi @JustinDoh1 ,

From what I can see:

  1. Create another table with distinct FacilityCode values
  2. Join this table with your fact tables (delete the relationship on JoinKey columns)
  3. Use FacilityCode column from FCODE table in your visuals

ERD_0-1634317370880.pngERD_1-1634317389706.png

ERD_2-1634317398890.png

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

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

View solution in original post

4 REPLIES 4
ERD
Super User
Super User

Hi @JustinDoh1 ,

From what I can see:

  1. Create another table with distinct FacilityCode values
  2. Join this table with your fact tables (delete the relationship on JoinKey columns)
  3. Use FacilityCode column from FCODE table in your visuals

ERD_0-1634317370880.pngERD_1-1634317389706.png

ERD_2-1634317398890.png

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

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

@ERD I was able to finish the task with you advice. It was brilliant. I have a quesiton though. I am curious why we do not use JoinKey as a key for the dimention table, but use FacilityCode as a key. Logically, I think commom key would be JoinKey, no? 

@JustinDoh1 ,

1) It is not recommended to join fact tables directly

2) You use FacilityCode in your visuals. There might be different facility codes in each table.

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

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

@ERD Actually, I updated the Pbix file with

3. Use FacilityCode column from FCODE table in your visuals.

 

I have attached it on this link.

 

Now, only issue is "Managed Medical Skiled" column does not show up on the "Budget" table with null value.

Is there anyway we could make it happen?

JustinDoh1_0-1634326566758.png

Thank you.

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.

Top Solution Authors