Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hello,
I have the following table visualization and i am trying to compare the values in both columns and if they do not match, then flag the column on the left. I have created a measure for this purpose, but due to some strange (probably long decimal?) differences, the similar values do not always match. Can this be enforced so that if the whole number values match, then it should be flagged as 1 otherwise 0? Any help is much appreciated!
Here is my measure:
Invoiced amount Check =
IF ( [Invoiced amount (calculated)] <> [Invoiced amount (input)], 1, 0 )
Solved! Go to Solution.
Hi,
Please try the below if it works.
Invoiced amount Check =
IF (
ROUND ( [Invoiced amount (calculated)], 0 )
<> ROUND ( [Invoiced amount (input)], 0 ),
1,
0
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
Please try the below if it works.
Invoiced amount Check =
IF (
ROUND ( [Invoiced amount (calculated)], 0 )
<> ROUND ( [Invoiced amount (input)], 0 ),
1,
0
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@Jihwan_Kim Thanks for your reply! Is it possible to implement the measure above into a slicer to filter the rows of the table? For example, a slicer with the following 2 options:
1. Show matching values (this would show only the table rows with the green tick)
2. Show non-matching values (this would show only the table rows with the red cross)
Hi,
I think it is possible.
If you can share your pbix file's link here, and then I can try to look into it to come up with a solution.
Thanks.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Here is the download link to the PBIX file from my Google Drive. Click on the download icon at the top right corner of the window: https://drive.google.com/file/d/1wfpiaxfaJxzNBiLSz1Jq_RIK9zZUGt0l/view?usp=sharing
Hi,
Thank you for your message.
Please kindly check the attached pbix file.
I suggest having a disconnected slicer table like the attached, and create measures that corresponds with the slicer selection. (V2 measures in the attached pbix file).
Thank you.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@Jihwan_Kim The slicer works but it is limited to only columns in the same table. I have added other tables with extra columns and made some relationships between the tables. So, i have updated the measures accordingly with the different table/column names.
I would like to include another column in the filtered results but when selecting the slicer options, it is only filtering in static mode - by keeping the same number of rows. Is it possible to fix this, so that it shows only the match or non-match list?
The updated measures:
Calc invoice amount Measure V2 =
SWITCH (
SELECTEDVALUE ( SlicerTable[Slicer] ),
"Match",
CALCULATE (
SUM ( 'Table 2'[Invoice amount (calculated)] ),
FILTER (
SUMMARIZE ( 'Table', 'Table'[Document ID] ),
[Invoiced amount Check] = 0
)
),
"Not-match",
CALCULATE (
SUM ( 'Table 2'[Invoice amount (calculated)] ),
FILTER (
SUMMARIZE ( 'Table', 'Table'[Document ID] ),
[Invoiced amount Check] = 1
)
),
SUM ( 'Table 2'[Invoice amount (calculated)] )
)
Input invoice amount Measure V2 =
SWITCH (
SELECTEDVALUE ( SlicerTable[Slicer] ),
"Match",
CALCULATE (
[Input invoice amount Measure],
FILTER (
SUMMARIZE ( 'Table', 'Table'[Document ID] ),
[Invoiced amount Check] = 0
)
),
"Not-match",
CALCULATE (
[Input invoice amount Measure],
FILTER (
SUMMARIZE ( 'Table', 'Table'[Document ID] ),
[Invoiced amount Check] = 1
)
),
[Input invoice amount Measure]
)
With no filter applied:
After filter selection:
Here is the download link to the updated PBIX file: https://drive.google.com/file/d/1faamqdp0lzb4OVUNyHyDz0timSozBpIE/view?usp=sharing
Hi,
Sorry that I do not understand.
Could you please check the attached file if it is what you are looking for? I tried to create a explicit measure for Quantity, instead of using Quantity Column itself.
Thank you.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@Jihwan_Kim Thanks! It works. I have tried to add the "Region" field as a new column to the table and adapted the measure but i get an error. Can you please suggest a solution?
Region Measure V2 =
SWITCH (
SELECTEDVALUE ( SlicerTable[Slicer] ),
"Match",
CALCULATE (
SUM ( 'Table 2'[Region] ),
FILTER ( SUMMARIZE ( 'Table', 'Table'[Document ID] ),
[Invoiced amount Check] = 0
)
),
"Not-match",
CALCULATE (
SUM ( 'Table 2'[Region] ),
FILTER (
SUMMARIZE ( 'Table', 'Table'[Document ID] ),
[Invoiced amount Check] = 1
)
),
SUM ( 'Table 2'[Region] )
)
I changed the 2 "SUM" to "COUNT" in the measure but it still does not work.
Hi,
Thank you for your message.
Do you want to add Region column from Table2?
I added the column like the attached file, but sorry that I could not understand the measure you wrote. May I ask what do you want to show by writing a Region measure V2 ?
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.