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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
JustinDoh1
Post Prodigy
Post Prodigy

Variance report using Metrics visual and static table

I am trying to create a variance report using a Metrics visual and a static table (that I am thinking about having a static data in SQL).

 

I created a metric visual as shown below:

JustinDoh1_0-1623104554075.png

These numbers were generated based on Count of outcome for each rows.

JustinDoh1_2-1623105012979.png

 

I have an illustration of data in a similar fashion (tabular) that I am trying to set up as a static table in SQL as shown below:

This data/table will eventually be used to do the variance report (find the difference on same category).

These data are not created in a table yet.

JustinDoh1_1-1623104718721.png

Now, I am trying to find the best approach to prepare data for the second table.

 

I don't think having a dummy data that repeats each row (just to create a Count for Aggregation) makes sense.

I guess the issue is how to compare data, one in visual (that have been aggregated in metrics) and other that have not been prepared yet.  

 

Thank you for help!

 

 

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @JustinDoh1 

I think you want to build a static table in data model like second screenshot.

You can try to use Power Query to transform your data model. I build a sample like yours to have a test.

Sample:

1.png

Matrix:

2.png

Firstly we need to use Group By function to get Count column as below.

3.png

Then we pivote "Matrix Column" as below to get the result.

4.png

Best Regards,

Rico Zhou

 

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

@Anonymous 

Thank you so much for your feedback.

I ended up doing this process:

1) Created a static table (Table2) for the second data.

2) Created a joined key (called 'JoinKey') for the two tables (Table1 and Table2).

3) I joined Many to Many relationship for the two tables (using the joined key 'JoinKey').

4) Tried with Quick Measure (for the first time 🙂 ).

It generated a measure like this:

Count of JoinKey minus Count of JoinKey = COUNTA('table1'[JoinKey]) -
COUNTA('table2'[JoinKey])

 

It worked somehow.  🙂

 

I have a question. What is risk of having Many to Many relationship?

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @JustinDoh1 

I think you want to build a static table in data model like second screenshot.

You can try to use Power Query to transform your data model. I build a sample like yours to have a test.

Sample:

1.png

Matrix:

2.png

Firstly we need to use Group By function to get Count column as below.

3.png

Then we pivote "Matrix Column" as below to get the result.

4.png

Best Regards,

Rico Zhou

 

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

 

 

@Anonymous 

Thank you so much for your feedback.

I ended up doing this process:

1) Created a static table (Table2) for the second data.

2) Created a joined key (called 'JoinKey') for the two tables (Table1 and Table2).

3) I joined Many to Many relationship for the two tables (using the joined key 'JoinKey').

4) Tried with Quick Measure (for the first time 🙂 ).

It generated a measure like this:

Count of JoinKey minus Count of JoinKey = COUNTA('table1'[JoinKey]) -
COUNTA('table2'[JoinKey])

 

It worked somehow.  🙂

 

I have a question. What is risk of having Many to Many relationship?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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