Forum Discussion
LACEG
10 years agoNew Member
Calculating the same value in 2 different columns
Hi All, I am new to Power BI and think it is a great analysis tool. I am attempting to create a report but I am facing issues (due to being new to the tool). The intention of the report is t...
- 10 years ago
- It's been five hours, calm down.
- Here's a sample .pbix for you.
You need to unpivot your import and export columns (this is done in Edit Queries). This allows a much cleaner measure setup:
// DAX // Measures Total = COUNTROWS( FactShipment ) Imports = CALCULATE( [Total] ,FactShipment[ShipmentType] = "Import" ) Exports = CALCULATE( [Total] ,FactShipment[ShipmentType] = "Export" )
LACEG
10 years agoNew Member
Can anyone help me with my query? :)
greggyb
10 years agoResident Rockstar
- It's been five hours, calm down.
- Here's a sample .pbix for you.
You need to unpivot your import and export columns (this is done in Edit Queries). This allows a much cleaner measure setup:
// DAX
// Measures
Total =
COUNTROWS( FactShipment )
Imports =
CALCULATE(
[Total]
,FactShipment[ShipmentType] = "Import"
)
Exports =
CALCULATE(
[Total]
,FactShipment[ShipmentType] = "Export"
)