Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi everyone,
I am new Power Bi learner,
I am facing an issue while creating a measure such that, I am having table - "Data Dump"
For countries IN, KR, CN, the meaure should reflect their respective count of docs
and for countries TW, SG, TH, measure should reflect there respective distinct count of docs.
My Effort:
DocCount = CALCULATE(IF('Data Dump'[Country] = "IN" || "KR" || "CN", COUNT('Data Dump'[Doc]), DISTINCTCOUNT('Data Dump'[Doc]))
Solved! Go to Solution.
Try this one:
DocCount =
IF (
MAX('Data Dump'[Country]) IN { "IN", "KR", "CN" },
COUNT ( 'Data Dump'[Doc] ),
DISTINCTCOUNT ( 'Data Dump'[Doc] )
)
Pbix attached,
Try this one:
DocCount =
IF (
MAX('Data Dump'[Country]) IN { "IN", "KR", "CN" },
COUNT ( 'Data Dump'[Doc] ),
DISTINCTCOUNT ( 'Data Dump'[Doc] )
)
Pbix attached,
That's to specify the current value in the column.
@CrazyExcelor , Try like
DocCount = CALCULATE(IF('Data Dump'[Country] in { "IN" , "KR" , "CN"}, COUNT('Data Dump'[Sales Document]), DISTINCTCOUNT('Data Dump'[Sales Document])))
Issue I am facing is, IF is not taking non measure column as a value .. it's not detecting 'Data Dump'[Country]
Try this.
DocCount =
IF (
'Data Dump'[Country] IN { "IN", "KR", "CN" },
COUNT ( 'Data Dump'[Sales Document] ),
DISTINCTCOUNT ( 'Data Dump'[Sales Document] )
)
Issue I am facing is, IF is not taking non measure column as a value .. it's not detecting 'Data Dump'[Country]
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
145 | |
87 | |
66 | |
52 | |
45 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |