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 moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
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]
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
94 | |
90 | |
83 | |
76 | |
49 |
User | Count |
---|---|
145 | |
140 | |
109 | |
68 | |
55 |