The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello.
Before explaining the problem, I will start with the objective: to know the number of IDs whose difference in the amount of Status is equal to 0.
My IDs can be associated with multiple Statuses, however, for a specific Status, if it is unique, I have a problem.
To find out which Ids had this problem I did a count of the total status, and later a count of a specific status. If the difference between the two counts for each of the IDs is zero, then that ID has to be parsed.
To know the total number of IDs I created the following measure:
But when I want to know the total on the card, the value appears "Blank".
If I select an Id in the visual, the count is done.
I cannot understand why. Can you help?
Solved! Go to Solution.
Hi @sara_pinto15 ,
Based on your description, I have created a simple sample:
Please try:
Measure =
VAR _a =
ADDCOLUMNS (
'FAT_SAP_Mobile_Cargamentos',
"Flag",
IF (
COUNTX (
FILTER (
'FAT_SAP_Mobile_Cargamentos',
[/BIC/ZIDMOBILE] = EARLIER ( FAT_SAP_Mobile_Cargamentos[/BIC/ZIDMOBILE] )
),
[/BIC/ZIDMOBILE]
)
- COUNTX (
FILTER (
'FAT_SAP_Mobile_Cargamentos',
[/BIC/ZIDMOBILE] = EARLIER ( FAT_SAP_Mobile_Cargamentos[/BIC/ZIDMOBILE] )
&& [/BIC/ZSTATSD] = 8
),
[/BIC/ZIDMOBILE]
) = 0,
"Yes",
"No"
)
)
RETURN
CALCULATE (
DISTINCTCOUNT ( FAT_SAP_Mobile_Cargamentos[/BIC/ZIDMOBILE] ),
FILTER ( _a, [Flag] = "Yes" )
)
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sara_pinto15 ,
Based on your description, I have created a simple sample:
Please try:
Measure =
VAR _a =
ADDCOLUMNS (
'FAT_SAP_Mobile_Cargamentos',
"Flag",
IF (
COUNTX (
FILTER (
'FAT_SAP_Mobile_Cargamentos',
[/BIC/ZIDMOBILE] = EARLIER ( FAT_SAP_Mobile_Cargamentos[/BIC/ZIDMOBILE] )
),
[/BIC/ZIDMOBILE]
)
- COUNTX (
FILTER (
'FAT_SAP_Mobile_Cargamentos',
[/BIC/ZIDMOBILE] = EARLIER ( FAT_SAP_Mobile_Cargamentos[/BIC/ZIDMOBILE] )
&& [/BIC/ZSTATSD] = 8
),
[/BIC/ZIDMOBILE]
) = 0,
"Yes",
"No"
)
)
RETURN
CALCULATE (
DISTINCTCOUNT ( FAT_SAP_Mobile_Cargamentos[/BIC/ZIDMOBILE] ),
FILTER ( _a, [Flag] = "Yes" )
)
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sara_pinto15 ,
Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?
Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, @v-jianboli-msft
So, I have a table like this:
If I have a /BIC/ZIDMOBIE with only status 8, like below I have a problem.
So, my goal is to know the quantity of cases that only have status 8, and put that value on a card.
Did this help clarify my problem a bit more?
Thank you very much, this solved my problem. 😊
User | Count |
---|---|
15 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |