Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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]
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |